|
@@ -13,7 +13,7 @@
|
|
<view class="shoptitle">
|
|
<view class="shoptitle">
|
|
<!--选择商店的全部商品 :disabled="isNnder"-->
|
|
<!--选择商店的全部商品 :disabled="isNnder"-->
|
|
<view class="checkbox-box" @click.stop="checkShop(item)">
|
|
<view class="checkbox-box" @click.stop="checkShop(item)">
|
|
- <view class="checkbox iconfont" :class="[item.checked ?'icon-yixuanze':'icon-weixuanze']"></view>
|
|
|
|
|
|
+ <view class="checkbox iconfont" :class="[item.isChecked ?'icon-yixuanze':'icon-weixuanze']"></view>
|
|
</view>
|
|
</view>
|
|
<view v-if="item.promotions" class="floor-item-act">
|
|
<view v-if="item.promotions" class="floor-item-act">
|
|
<view class="floor-tags" @click.stop="clickPopupShow(item,2)">{{item.promotions.name}}</view>
|
|
<view class="floor-tags" @click.stop="clickPopupShow(item,2)">{{item.promotions.name}}</view>
|
|
@@ -21,17 +21,17 @@
|
|
<view class="text">{{item.name}}</view>
|
|
<view class="text">{{item.name}}</view>
|
|
</view>
|
|
</view>
|
|
<view class="productlist">
|
|
<view class="productlist">
|
|
- <view class="goods-pros" v-for="(pros,idx) in item.productsList" :key="idx">
|
|
|
|
|
|
+ <view class="goods-pros" v-for="(pros,idx) in item.cartList" :key="idx">
|
|
<view class="goods-pros-t">
|
|
<view class="goods-pros-t">
|
|
<!--选择商品-->
|
|
<!--选择商品-->
|
|
<view class="checkbox-box" @click.stop="ischeck(item,pros,idx)">
|
|
<view class="checkbox-box" @click.stop="ischeck(item,pros,idx)">
|
|
- <view class="checkbox iconfont" :class="[pros.productsChecked ?'icon-yixuanze':'icon-weixuanze']"></view>
|
|
|
|
|
|
+ <view class="checkbox iconfont" :class="[pros.isChecked ?'icon-yixuanze':'icon-weixuanze']"></view>
|
|
</view>
|
|
</view>
|
|
- <view class="pros-img" @click.stop="navToListPage(pros.productID)">
|
|
|
|
- <image :src="pros.mainImage ? pros.mainImage :''" alt="" />
|
|
|
|
|
|
+ <view class="pros-img" @click.stop="navToListPage(pros.productId)">
|
|
|
|
+ <image :src="pros.image ? pros.image :''" alt="" />
|
|
</view>
|
|
</view>
|
|
<view class="pros-product">
|
|
<view class="pros-product">
|
|
- <view class="producttitle" @click.stop="navToListPage(pros.productID)" >
|
|
|
|
|
|
+ <view class="producttitle" @click.stop="navToListPage(pros.productId)" >
|
|
{{pros.name}}
|
|
{{pros.name}}
|
|
</view>
|
|
</view>
|
|
<view class="productspec">规格:{{pros.unit ? pros.unit : ''}}</view>
|
|
<view class="productspec">规格:{{pros.unit ? pros.unit : ''}}</view>
|
|
@@ -42,13 +42,14 @@
|
|
<!--使用过滤器对总价改变-->
|
|
<!--使用过滤器对总价改变-->
|
|
<view class="price" :class="PromotionsFormat(pros.promotions) ? 'disabled' : ''">
|
|
<view class="price" :class="PromotionsFormat(pros.promotions) ? 'disabled' : ''">
|
|
<text>¥</text>
|
|
<text>¥</text>
|
|
- {{ (PromotionsFormat(pros.promotions) ? pros.price1 : pros.retailPrice) | NumFormat }}
|
|
|
|
|
|
+ {{ (PromotionsFormat(pros.promotions) ? pros.originalPrice : pros.price) | NumFormat }}
|
|
</view>
|
|
</view>
|
|
<view class="count" :class="[isshowDelbtn ? 'none':'show']">
|
|
<view class="count" :class="[isshowDelbtn ? 'none':'show']">
|
|
|
|
+ <text class="count-tips" v-if="pros.number<pros.min">起订量:{{pros.min}}</text>
|
|
<text class="count-tips step" v-if="pros.isStep">购买量必须为起订量的整数倍</text>
|
|
<text class="count-tips step" v-if="pros.isStep">购买量必须为起订量的整数倍</text>
|
|
<view class="number-box">
|
|
<view class="number-box">
|
|
<view class="iconfont icon-jianhao" @click="changeCountSub(item,pros)"></view>
|
|
<view class="iconfont icon-jianhao" @click="changeCountSub(item,pros)"></view>
|
|
- <input class="btn-input" type="number" maxlength='6' v-model="pros.productCount" @blur="changeNnmber($event,item,pros)">
|
|
|
|
|
|
+ <input class="btn-input" type="number" maxlength='6' v-model="pros.number" @blur="changeNnmber($event,item,pros)">
|
|
<view class="iconfont icon-jiahao" @click="changeCountAdd(item,pros)"></view>
|
|
<view class="iconfont icon-jiahao" @click="changeCountAdd(item,pros)"></view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -60,7 +61,9 @@
|
|
:¥{{ pros.promotions == null ? '0.00' : pros.promotions.touchPrice | NumFormat}}
|
|
:¥{{ pros.promotions == null ? '0.00' : pros.promotions.touchPrice | NumFormat}}
|
|
</text>
|
|
</text>
|
|
</view>
|
|
</view>
|
|
- <view v-else-if="pros.promotions.type!=3" class="floor-tags" @click.stop="clickPopupShow(pros,2)">{{pros.promotions.name}}</view>
|
|
|
|
|
|
+ <view v-else-if="pros.promotions.type!=3" class="floor-tags" @click.stop="clickPopupShow(pros,2)">
|
|
|
|
+ {{pros.promotions.name}}
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
<view v-if="pros.actStatus == null && pros.ladderFlag == 1" class="floor-item-act">
|
|
<view v-if="pros.actStatus == null && pros.ladderFlag == 1" class="floor-item-act">
|
|
<view class="floor-tags" @click.stop="clickPopupShow(pros,2)">阶梯价格</view>
|
|
<view class="floor-tags" @click.stop="clickPopupShow(pros,2)">阶梯价格</view>
|
|
@@ -90,7 +93,7 @@
|
|
<!--选择商品-->
|
|
<!--选择商品-->
|
|
<view class="checkbox-box" @click.stop="ischeckFailure(failure)" v-if="isshowDelbtn">
|
|
<view class="checkbox-box" @click.stop="ischeckFailure(failure)" v-if="isshowDelbtn">
|
|
<button class="checkbox iconfont"
|
|
<button class="checkbox iconfont"
|
|
- :class="[ failure.productsChecked ? 'icon-yixuanze':'icon-weixuanze']">
|
|
|
|
|
|
+ :class="[ failure.isChecked ? 'icon-yixuanze':'icon-weixuanze']">
|
|
</button>
|
|
</button>
|
|
</view>
|
|
</view>
|
|
<text class="img-tip">失效</text>
|
|
<text class="img-tip">失效</text>
|
|
@@ -162,7 +165,14 @@
|
|
import activiPopup from "@/components/cm-module/productDetails/cm-activipopu"
|
|
import activiPopup from "@/components/cm-module/productDetails/cm-activipopu"
|
|
import modalLayer from "@/components/modal-layer"
|
|
import modalLayer from "@/components/modal-layer"
|
|
import { mapState,mapMutations } from 'vuex';
|
|
import { mapState,mapMutations } from 'vuex';
|
|
-
|
|
|
|
|
|
+ const defaultListQuery = {
|
|
|
|
+ clubId:0, // 机构Id
|
|
|
|
+ serviceProviderId:0, //协销Id
|
|
|
|
+ againBuyProductIds:'',// 再次购买商品ids
|
|
|
|
+ pageNum:1, // 页码
|
|
|
|
+ pageSize:10, // 条数
|
|
|
|
+
|
|
|
|
+ };
|
|
export default{
|
|
export default{
|
|
components:{
|
|
components:{
|
|
tuiSkeleton,
|
|
tuiSkeleton,
|
|
@@ -173,12 +183,10 @@
|
|
},
|
|
},
|
|
data(){
|
|
data(){
|
|
return{
|
|
return{
|
|
- clubId:'', //机构ID
|
|
|
|
- userID:'',
|
|
|
|
kindCount:0,
|
|
kindCount:0,
|
|
- serviceProviderId:'',//协销ID
|
|
|
|
isStock:'',
|
|
isStock:'',
|
|
popupShow:false,
|
|
popupShow:false,
|
|
|
|
+ listQuery: Object.assign({}, defaultListQuery), // 购物车立即结算确认订单参数
|
|
handlerPros:{},//监听单挑促销商品
|
|
handlerPros:{},//监听单挑促销商品
|
|
promotionsList:[],//促销活动列表
|
|
promotionsList:[],//促销活动列表
|
|
failureList:[], //失效商品列表
|
|
failureList:[], //失效商品列表
|
|
@@ -201,13 +209,10 @@
|
|
loadding: false,
|
|
loadding: false,
|
|
pullUpOn: true,
|
|
pullUpOn: true,
|
|
pullFlag: true,
|
|
pullFlag: true,
|
|
- pageSize: 10,
|
|
|
|
- pageNum: 1,
|
|
|
|
submitIds:[],
|
|
submitIds:[],
|
|
depositIds : [6060,6061,6062,6063,6064],//定金商品ID
|
|
depositIds : [6060,6061,6062,6063,6064],//定金商品ID
|
|
rechargeIds : [6065,6066,6067,6068,6069],//充值余额商品ID
|
|
rechargeIds : [6065,6066,6067,6068,6069],//充值余额商品ID
|
|
isIphoneX:this.$store.state.isIphoneX,
|
|
isIphoneX:this.$store.state.isIphoneX,
|
|
- againBuyProductIds:''
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad(){
|
|
onLoad(){
|
|
@@ -231,8 +236,9 @@
|
|
this.isCheckAll=false//是否全选
|
|
this.isCheckAll=false//是否全选
|
|
this.submitIds = []
|
|
this.submitIds = []
|
|
this.$api.getStorage().then((resolve) => {
|
|
this.$api.getStorage().then((resolve) => {
|
|
- this.serviceProviderId = resolve.serviceProviderId;
|
|
|
|
|
|
+ this.listQuery.serviceProviderId = resolve.serviceProviderId ? resolve.serviceProviderId : 0
|
|
this.initGetCartGoodsList();
|
|
this.initGetCartGoodsList();
|
|
|
|
+ this.getClubProductNum()
|
|
})
|
|
})
|
|
},
|
|
},
|
|
initLogin(){
|
|
initLogin(){
|
|
@@ -298,29 +304,28 @@
|
|
}, 500)
|
|
}, 500)
|
|
},
|
|
},
|
|
initGetCartGoodsList(){//初始化购物车 index:1
|
|
initGetCartGoodsList(){//初始化购物车 index:1
|
|
- let params = {clubId:this.clubId,serviceProviderId:this.serviceProviderId,pageNum:1,pageSize:this.pageSize,againBuyProductIds:this.againBuyProductIds}
|
|
|
|
- this.SellerService.GetSellerShoppingInfo(params).then(response =>{
|
|
|
|
|
|
+ this.SellerService.GetSellerShoppingInfo(this.listQuery).then(response =>{
|
|
this.skeletonShow = false
|
|
this.skeletonShow = false
|
|
- this.$store.commit('updateAllNum',response.data.cartQuantity)
|
|
|
|
- this.promotionsList = response.data.promotionsList;
|
|
|
|
- this.kindCount = response.data.productCount;
|
|
|
|
- const resultsData = response.data.pageDate;
|
|
|
|
- if(resultsData.results.length > 0||response.data.invalidProductList.length>0){
|
|
|
|
|
|
+ let data = response.data
|
|
|
|
+ let dataPage = data.pageDate
|
|
|
|
+ this.promotionsList = data.promotionsList;
|
|
|
|
+
|
|
|
|
+ if(dataPage.list.length > 0||data.invalidProductList.length>0){
|
|
this.isEmpty =false
|
|
this.isEmpty =false
|
|
}else{
|
|
}else{
|
|
this.isEmpty =true
|
|
this.isEmpty =true
|
|
}
|
|
}
|
|
- if(resultsData.results&&resultsData.results.length > 0){
|
|
|
|
- this.hasNextPage = resultsData.hasNextPage;
|
|
|
|
- this.goodsList = resultsData.results;
|
|
|
|
|
|
+ if(dataPage.list && dataPage.list.length > 0){
|
|
|
|
+ this.hasNextPage = dataPage.hasNextPage;
|
|
|
|
+ this.goodsList = dataPage.list;
|
|
this.goodsList.forEach((item,index) => {
|
|
this.goodsList.forEach((item,index) => {
|
|
- let productsListLength = item.productsList.length,invalidLength = 0;
|
|
|
|
- item.productsList.forEach(pros => {
|
|
|
|
- pros.shopID = item.shopID;
|
|
|
|
|
|
+ let cartListLength = item.cartList.length,invalidLength = 0;
|
|
|
|
+ item.cartList.forEach(pros => {
|
|
|
|
+ pros.shopId = item.shopId;
|
|
pros.isStep = false
|
|
pros.isStep = false
|
|
if(pros.step === 2){
|
|
if(pros.step === 2){
|
|
- if(pros.productCount % pros.minBuyNumber != 0){
|
|
|
|
- pros.productCount = pros.minBuyNumber
|
|
|
|
|
|
+ if(pros.number % pros.min != 0){
|
|
|
|
+ pros.number = pros.min
|
|
this.totalShopPeice()
|
|
this.totalShopPeice()
|
|
this.updateShoppogNum(pros)
|
|
this.updateShoppogNum(pros)
|
|
}
|
|
}
|
|
@@ -364,21 +369,20 @@
|
|
})
|
|
})
|
|
},
|
|
},
|
|
getOnReachBottomData(){//上拉加载
|
|
getOnReachBottomData(){//上拉加载
|
|
- this.pageNum+=1
|
|
|
|
- let params = {clubId:this.clubId,serviceProviderId:this.serviceProviderId,pageNum:this.pageNum,pageSize:this.pageSize}
|
|
|
|
- this.SellerService.GetSellerShoppingInfo(params).then(response =>{
|
|
|
|
|
|
+ this.listQuery.pageNum+=1
|
|
|
|
+ this.SellerService.GetSellerShoppingInfo(this.listQuery).then(response =>{
|
|
let resultsData = response.data.pageDate
|
|
let resultsData = response.data.pageDate
|
|
this.promotionsList = response.data.promotionsList;
|
|
this.promotionsList = response.data.promotionsList;
|
|
this.hasNextPage = resultsData.hasNextPage;
|
|
this.hasNextPage = resultsData.hasNextPage;
|
|
this.goodsList = this.goodsList.concat(resultsData.results)
|
|
this.goodsList = this.goodsList.concat(resultsData.results)
|
|
this.goodsList.forEach((item,index) => {
|
|
this.goodsList.forEach((item,index) => {
|
|
- let productsListLength = item.productsList.length,invalidLength = 0;
|
|
|
|
- item.productsList.forEach(pros => {
|
|
|
|
- pros.shopID = item.shopID;
|
|
|
|
|
|
+ let productsListLength = item.cartList.length,invalidLength = 0;
|
|
|
|
+ item.cartList.forEach(pros => {
|
|
|
|
+ pros.shopId = item.shopId;
|
|
pros.isStep = false
|
|
pros.isStep = false
|
|
if(pros.step === 2){
|
|
if(pros.step === 2){
|
|
- if(pros.productCount % pros.minBuyNumber != 0){
|
|
|
|
- pros.productCount = pros.minBuyNumber
|
|
|
|
|
|
+ if(pros.number % pros.min != 0){
|
|
|
|
+ pros.number = pros.min
|
|
this.totalShopPeice()
|
|
this.totalShopPeice()
|
|
this.updateShoppogNum(pros)
|
|
this.updateShoppogNum(pros)
|
|
}
|
|
}
|
|
@@ -400,14 +404,24 @@
|
|
this.$util.msg(error.msg,2000);
|
|
this.$util.msg(error.msg,2000);
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ getClubProductNum(){// 获取协销下机构购物车数量
|
|
|
|
+ this.SellerService.GetSellerProductNum(
|
|
|
|
+ {
|
|
|
|
+ clubId:this.listQuery.clubId,
|
|
|
|
+ serviceProviderId:this.listQuery.serviceProviderId,
|
|
|
|
+ }
|
|
|
|
+ ).then(response =>{
|
|
|
|
+ this.kindCount = response.data
|
|
|
|
+ })
|
|
|
|
+ },
|
|
ischeck(item,pro){//为未选中的时候改变为true,反之为true
|
|
ischeck(item,pro){//为未选中的时候改变为true,反之为true
|
|
- pro.productsChecked = !pro.productsChecked;
|
|
|
|
- if(pro.productsChecked) {
|
|
|
|
- if(!this.submitIds.includes(pro.productID*1)){
|
|
|
|
- this.submitIds.push(pro.productID);
|
|
|
|
|
|
+ pro.isChecked = !pro.isChecked;
|
|
|
|
+ if(pro.isChecked) {
|
|
|
|
+ if(!this.submitIds.includes(pro.productId*1)){
|
|
|
|
+ this.submitIds.push(pro.productId);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- var lent = this.submitIds.indexOf(pro.productID*1);
|
|
|
|
|
|
+ var lent = this.submitIds.indexOf(pro.productId*1);
|
|
if(lent >=0 ){
|
|
if(lent >=0 ){
|
|
this.submitIds.splice(lent, 1);
|
|
this.submitIds.splice(lent, 1);
|
|
}
|
|
}
|
|
@@ -416,50 +430,50 @@
|
|
this.updateCheckAllBtn();
|
|
this.updateCheckAllBtn();
|
|
},
|
|
},
|
|
updateProductCheckedAllBtn(item) {// 单独每个供应商的勾选判断
|
|
updateProductCheckedAllBtn(item) {// 单独每个供应商的勾选判断
|
|
- let productsList = item.productsList,
|
|
|
|
|
|
+ let productsList = item.cartList,
|
|
productsCheckedLength = 0,
|
|
productsCheckedLength = 0,
|
|
disabledLength = 0;
|
|
disabledLength = 0;
|
|
if(this.isshowDelbtn) {
|
|
if(this.isshowDelbtn) {
|
|
productsList.forEach(pros => {
|
|
productsList.forEach(pros => {
|
|
- if(pros.productsChecked) {
|
|
|
|
|
|
+ if(pros.isChecked) {
|
|
productsCheckedLength++;
|
|
productsCheckedLength++;
|
|
}
|
|
}
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
productsList.forEach(pros => {
|
|
productsList.forEach(pros => {
|
|
- if(pros.productsChecked) {
|
|
|
|
|
|
+ if(pros.isChecked) {
|
|
productsCheckedLength++;
|
|
productsCheckedLength++;
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- item.checked = productsCheckedLength === productsList.length - disabledLength;
|
|
|
|
|
|
+ item.isChecked = productsCheckedLength === productsList.length - disabledLength;
|
|
},
|
|
},
|
|
updateCheckAllBtn() {// 全选勾选判断
|
|
updateCheckAllBtn() {// 全选勾选判断
|
|
let goodsCheckedLength = 0,
|
|
let goodsCheckedLength = 0,
|
|
disabledListLength = 0,
|
|
disabledListLength = 0,
|
|
goodsList = this.goodsList;
|
|
goodsList = this.goodsList;
|
|
goodsList.forEach(item => {
|
|
goodsList.forEach(item => {
|
|
- if(item.checked) {
|
|
|
|
|
|
+ if(item.isChecked) {
|
|
goodsCheckedLength++;
|
|
goodsCheckedLength++;
|
|
}
|
|
}
|
|
})
|
|
})
|
|
this.isCheckAll = goodsCheckedLength === goodsList.length - disabledListLength;
|
|
this.isCheckAll = goodsCheckedLength === goodsList.length - disabledListLength;
|
|
},
|
|
},
|
|
checkShop(item){//与单选商品类似
|
|
checkShop(item){//与单选商品类似
|
|
- item.checked = !item.checked;
|
|
|
|
|
|
+ item.isChecked = !item.isChecked;
|
|
this.setProductChecked(item);
|
|
this.setProductChecked(item);
|
|
this.updateCheckAllBtn();
|
|
this.updateCheckAllBtn();
|
|
},
|
|
},
|
|
setProductChecked(item) {
|
|
setProductChecked(item) {
|
|
- item.productsList.forEach(pros=>{
|
|
|
|
- if(item.checked) {
|
|
|
|
- pros.productsChecked = true;
|
|
|
|
- if(!this.submitIds.includes(pros.productID*1)){
|
|
|
|
- this.submitIds.push(pros.productID);
|
|
|
|
|
|
+ item.cartList.forEach(pros=>{
|
|
|
|
+ if(item.isChecked) {
|
|
|
|
+ pros.isChecked = true;
|
|
|
|
+ if(!this.submitIds.includes(pros.productId*1)){
|
|
|
|
+ this.submitIds.push(pros.productId);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- pros.productsChecked = false;
|
|
|
|
- var lent = this.submitIds.indexOf(pros.productID*1);
|
|
|
|
|
|
+ pros.isChecked = false;
|
|
|
|
+ var lent = this.submitIds.indexOf(pros.productId*1);
|
|
if(lent >=0 ){
|
|
if(lent >=0 ){
|
|
this.submitIds.splice(lent, 1);
|
|
this.submitIds.splice(lent, 1);
|
|
}
|
|
}
|
|
@@ -470,12 +484,12 @@
|
|
if(this.isshowDelbtn) {
|
|
if(this.isshowDelbtn) {
|
|
// 当管理删除按钮出现时,失效的商品可被选择
|
|
// 当管理删除按钮出现时,失效的商品可被选择
|
|
this.goodsList.forEach((item)=>{
|
|
this.goodsList.forEach((item)=>{
|
|
- item.checked = this.isCheckAll;
|
|
|
|
|
|
+ item.isChecked = this.isCheckAll;
|
|
this.setProductChecked(item);
|
|
this.setProductChecked(item);
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
this.goodsList.forEach((item)=>{
|
|
this.goodsList.forEach((item)=>{
|
|
- item.checked = this.isCheckAll;
|
|
|
|
|
|
+ item.isChecked = this.isCheckAll;
|
|
this.setProductChecked(item);
|
|
this.setProductChecked(item);
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -492,9 +506,9 @@
|
|
if(item.promotions && item.promotions.mode == 2){
|
|
if(item.promotions && item.promotions.mode == 2){
|
|
let prosPrice=0;
|
|
let prosPrice=0;
|
|
let totalOriginalPrice = 0;//商铺合计原价
|
|
let totalOriginalPrice = 0;//商铺合计原价
|
|
- item.productsList.forEach(pros=>{
|
|
|
|
- prosPrice += pros.retailPrice*pros.productCount
|
|
|
|
- totalOriginalPrice += pros.retailPrice*pros.productCount
|
|
|
|
|
|
+ item.cartList.forEach(pros=>{
|
|
|
|
+ prosPrice += pros.price*pros.number
|
|
|
|
+ totalOriginalPrice += pros.price*pros.number
|
|
})
|
|
})
|
|
if(prosPrice >= item.promotions.touchPrice){
|
|
if(prosPrice >= item.promotions.touchPrice){
|
|
item.totalPrice = prosPrice - item.promotions.reducedPrice
|
|
item.totalPrice = prosPrice - item.promotions.reducedPrice
|
|
@@ -508,9 +522,9 @@
|
|
let _totalPrice = 0;
|
|
let _totalPrice = 0;
|
|
let _reducedPrice = 0;
|
|
let _reducedPrice = 0;
|
|
let _totalOriginalPrice =0;
|
|
let _totalOriginalPrice =0;
|
|
- item.productsList.forEach(pros=>{
|
|
|
|
- let _price = pros.retailPrice*pros.productCount
|
|
|
|
- _totalOriginalPrice += pros.retailPrice*pros.productCount;
|
|
|
|
|
|
+ item.cartList.forEach(pros=>{
|
|
|
|
+ let _price = pros.price*pros.number
|
|
|
|
+ _totalOriginalPrice += pros.price*pros.number;
|
|
if(pros.promotions && pros.promotions.type != 2 && pros.promotions.mode == 2){
|
|
if(pros.promotions && pros.promotions.type != 2 && pros.promotions.mode == 2){
|
|
if(_price >= pros.promotions.touchPrice){
|
|
if(_price >= pros.promotions.touchPrice){
|
|
_price = _price - pros.promotions.reducedPrice
|
|
_price = _price - pros.promotions.reducedPrice
|
|
@@ -519,7 +533,7 @@
|
|
_totalPrice += _price
|
|
_totalPrice += _price
|
|
}else{
|
|
}else{
|
|
_reducedPrice = 0;
|
|
_reducedPrice = 0;
|
|
- _totalPrice += pros.retailPrice*pros.productCount;
|
|
|
|
|
|
+ _totalPrice += pros.price*pros.number;
|
|
}
|
|
}
|
|
})
|
|
})
|
|
item.reducedPrice = _reducedPrice
|
|
item.reducedPrice = _reducedPrice
|
|
@@ -538,13 +552,13 @@
|
|
item.totalprice = 0;
|
|
item.totalprice = 0;
|
|
item.reducedprice = 0;
|
|
item.reducedprice = 0;
|
|
item.originalprice = 0;
|
|
item.originalprice = 0;
|
|
- item.productsList.forEach(pros=>{
|
|
|
|
- if(pros.productsChecked){
|
|
|
|
- supplierPrice += pros.retailPrice*pros.productCount;
|
|
|
|
|
|
+ item.cartList.forEach(pros=>{
|
|
|
|
+ if(pros.isChecked){
|
|
|
|
+ supplierPrice += pros.price*pros.number;
|
|
// 单品满减
|
|
// 单品满减
|
|
if(pros.promotions && pros.promotions.type*1===1 && pros.promotions.mode*1===2){
|
|
if(pros.promotions && pros.promotions.type*1===1 && pros.promotions.mode*1===2){
|
|
// 单品满减-重新计算供应商总价/满减金额
|
|
// 单品满减-重新计算供应商总价/满减金额
|
|
- if(pros.retailPrice*pros.productCount >= pros.promotions.touchPrice){
|
|
|
|
|
|
+ if(pros.price*pros.number >= pros.promotions.touchPrice){
|
|
supplierPrice -= pros.promotions.reducedPrice;
|
|
supplierPrice -= pros.promotions.reducedPrice;
|
|
supplierReducedPrice += pros.promotions.reducedPrice;
|
|
supplierReducedPrice += pros.promotions.reducedPrice;
|
|
}
|
|
}
|
|
@@ -572,8 +586,8 @@
|
|
if(promotions.mode*1===2 && promotions.type*1===2){
|
|
if(promotions.mode*1===2 && promotions.type*1===2){
|
|
let total = 0;
|
|
let total = 0;
|
|
promotions.products.forEach(pros=>{
|
|
promotions.products.forEach(pros=>{
|
|
- if (this.submitIds.includes(pros.productID*1)){
|
|
|
|
- total += pros.productCount * pros.retailPrice;
|
|
|
|
|
|
+ if (this.submitIds.includes(pros.productId*1)){
|
|
|
|
+ total += pros.number * pros.price;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
if(total>=promotions.touchPrice){
|
|
if(total>=promotions.touchPrice){
|
|
@@ -596,10 +610,10 @@
|
|
let validList =[];
|
|
let validList =[];
|
|
let productsList =[];
|
|
let productsList =[];
|
|
this.goodsList.forEach(item=>{
|
|
this.goodsList.forEach(item=>{
|
|
- productsList = item.productsList
|
|
|
|
|
|
+ productsList = item.cartList
|
|
productsList.forEach(pros=>{
|
|
productsList.forEach(pros=>{
|
|
- if(pros.productsChecked){
|
|
|
|
- prosAllCount+=parseInt(pros.productCount);
|
|
|
|
|
|
+ if(pros.isChecked){
|
|
|
|
+ prosAllCount+=parseInt(pros.number);
|
|
this.allCount = prosAllCount
|
|
this.allCount = prosAllCount
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -608,11 +622,11 @@
|
|
changeCountAdd(item,pros){//商品数量加加
|
|
changeCountAdd(item,pros){//商品数量加加
|
|
if(pros.step === 2){
|
|
if(pros.step === 2){
|
|
pros.isStep = false
|
|
pros.isStep = false
|
|
- pros.productCount += pros.minBuyNumber
|
|
|
|
|
|
+ pros.number += pros.min
|
|
this.processActivityPrice(pros)
|
|
this.processActivityPrice(pros)
|
|
this.isStock = false
|
|
this.isStock = false
|
|
}else{
|
|
}else{
|
|
- pros.productCount++
|
|
|
|
|
|
+ pros.number++
|
|
this.processActivityPrice(pros)
|
|
this.processActivityPrice(pros)
|
|
this.isStock = false
|
|
this.isStock = false
|
|
}
|
|
}
|
|
@@ -620,16 +634,16 @@
|
|
this.totalShopPeice();
|
|
this.totalShopPeice();
|
|
},
|
|
},
|
|
changeCountSub(item,pros){//商品数量减减
|
|
changeCountSub(item,pros){//商品数量减减
|
|
- if(pros.productCount<=pros.minBuyNumber){
|
|
|
|
- pros.productCount= pros.minBuyNumber
|
|
|
|
- this.$util.msg(`该商品最小起订量为${pros.minBuyNumber}`,2000);
|
|
|
|
|
|
+ if(pros.number<=pros.min){
|
|
|
|
+ pros.number= pros.min
|
|
|
|
+ this.$util.msg(`该商品最小起订量为${pros.min}`,2000);
|
|
return
|
|
return
|
|
}else{
|
|
}else{
|
|
if(pros.step === 2){
|
|
if(pros.step === 2){
|
|
pros.isStep = false
|
|
pros.isStep = false
|
|
- pros.productCount -= pros.minBuyNumber
|
|
|
|
|
|
+ pros.number -= pros.min
|
|
}else{
|
|
}else{
|
|
- pros.productCount--
|
|
|
|
|
|
+ pros.number--
|
|
}
|
|
}
|
|
this.processActivityPrice(pros)
|
|
this.processActivityPrice(pros)
|
|
}
|
|
}
|
|
@@ -639,36 +653,41 @@
|
|
changeNnmber(e,item,pros){//输入商品数量更新
|
|
changeNnmber(e,item,pros){//输入商品数量更新
|
|
let _value = e.detail.value;
|
|
let _value = e.detail.value;
|
|
if(!this.$api.isNumber(_value)){
|
|
if(!this.$api.isNumber(_value)){
|
|
- pros.productCount = pros.minBuyNumber
|
|
|
|
- }else if(_value < pros.minBuyNumber){
|
|
|
|
- this.$util.msg(`该商品最小起订量为${pros.minBuyNumber}`,2000);
|
|
|
|
- pros.productCount = pros.minBuyNumber
|
|
|
|
- }else if(_value % pros.minBuyNumber != 0){
|
|
|
|
|
|
+ pros.number = pros.min
|
|
|
|
+ }else if(_value < pros.min){
|
|
|
|
+ this.$util.msg(`该商品最小起订量为${pros.min}`,2000);
|
|
|
|
+ pros.number = pros.min
|
|
|
|
+ }else if(_value % pros.min != 0){
|
|
pros.isStep = true
|
|
pros.isStep = true
|
|
- pros.productCount = pros.minBuyNumber
|
|
|
|
|
|
+ pros.number = pros.min
|
|
}else{
|
|
}else{
|
|
pros.isStep = false
|
|
pros.isStep = false
|
|
- pros.productCount = e.detail.value
|
|
|
|
|
|
+ pros.number = e.detail.value
|
|
this.processActivityPrice(pros)
|
|
this.processActivityPrice(pros)
|
|
}
|
|
}
|
|
this.updateShoppogNum(pros)
|
|
this.updateShoppogNum(pros)
|
|
this.totalShopPeice();
|
|
this.totalShopPeice();
|
|
},
|
|
},
|
|
processActivityPrice(pros){//单独处理活动价格和阶梯价格
|
|
processActivityPrice(pros){//单独处理活动价格和阶梯价格
|
|
- let ladderPriceList = pros.ladderPriceList;
|
|
|
|
- if(pros.ladderPriceFlag == '1'){
|
|
|
|
|
|
+ let ladderPriceList = pros.ladderPrices;
|
|
|
|
+ if(pros.ladderFlag == 0 || pros.actStatus == 1){
|
|
|
|
+ pros.price = pros.price
|
|
|
|
+ }else{
|
|
ladderPriceList.forEach((item,index)=>{
|
|
ladderPriceList.forEach((item,index)=>{
|
|
- if(pros.productCount>=item.buyNum){
|
|
|
|
- pros.retailPrice = item.buyPrice
|
|
|
|
|
|
+ if(pros.number>=item.buyNum){
|
|
|
|
+ pros.price = item.buyPrice
|
|
}
|
|
}
|
|
- });
|
|
|
|
- }else{
|
|
|
|
- pros.retailPrice = pros.retailPrice
|
|
|
|
|
|
+ })
|
|
}
|
|
}
|
|
},
|
|
},
|
|
updateShoppogNum(pros){//加减购物车商品更新到后台
|
|
updateShoppogNum(pros){//加减购物车商品更新到后台
|
|
- let params ={id:pros.sellerCartId,productID:pros.productID,num:pros.productCount}
|
|
|
|
- this.SellerService.SellerAddProductNum(params).then(response =>{
|
|
|
|
|
|
+ this.SellerService.SellerAddProductNum(
|
|
|
|
+ {
|
|
|
|
+ id:pros.id,
|
|
|
|
+ productCount:pros.number,
|
|
|
|
+ serviceProviderId:this.listQuery.serviceProviderId,
|
|
|
|
+ }
|
|
|
|
+ ).then(response =>{
|
|
this.isshowDelbtn = false;
|
|
this.isshowDelbtn = false;
|
|
this.initGetCartGoodsList();
|
|
this.initGetCartGoodsList();
|
|
}).catch(error =>{
|
|
}).catch(error =>{
|
|
@@ -678,12 +697,12 @@
|
|
toConfirmation(){//跳转确认订单页面
|
|
toConfirmation(){//跳转确认订单页面
|
|
let setGoodsList=[];
|
|
let setGoodsList=[];
|
|
let productIdList = [];
|
|
let productIdList = [];
|
|
- let productID = '';
|
|
|
|
|
|
+ let productIds = '';
|
|
this.goodsList.forEach(res=>{
|
|
this.goodsList.forEach(res=>{
|
|
- let products = res.productsList
|
|
|
|
|
|
+ let products = res.cartList
|
|
products.forEach(pros=>{
|
|
products.forEach(pros=>{
|
|
- if(pros.productsChecked){
|
|
|
|
- setGoodsList.push(pros.productID)
|
|
|
|
|
|
+ if(pros.isChecked){
|
|
|
|
+ setGoodsList.push(pros.productId)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
})
|
|
})
|
|
@@ -696,9 +715,9 @@
|
|
* @获取勾选的商品分类ID拼接字符串格式逗号隔开,最后一个逗号去掉
|
|
* @获取勾选的商品分类ID拼接字符串格式逗号隔开,最后一个逗号去掉
|
|
*/
|
|
*/
|
|
this.goodsList.forEach(el=>{
|
|
this.goodsList.forEach(el=>{
|
|
- el.productsList.forEach(pros=>{
|
|
|
|
- if(pros.productsChecked){
|
|
|
|
- productIdList.push(pros.productID)
|
|
|
|
|
|
+ el.cartList.forEach(pros=>{
|
|
|
|
+ if(pros.isChecked){
|
|
|
|
+ productIdList.push(pros.productId)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
})
|
|
})
|
|
@@ -709,29 +728,23 @@
|
|
if(productIdList.length == 1 && isHasDepositlds.length === 1 && isHasRechargeIds.length === 0){
|
|
if(productIdList.length == 1 && isHasDepositlds.length === 1 && isHasRechargeIds.length === 0){
|
|
console.log('定金商品')
|
|
console.log('定金商品')
|
|
productIdList.forEach(item =>{
|
|
productIdList.forEach(item =>{
|
|
- productID += item +','
|
|
|
|
|
|
+ productIds += item +','
|
|
})
|
|
})
|
|
}else if(productIdList.length == 1 && isHasRechargeIds.length === 1 && isHasDepositlds.length === 0){
|
|
}else if(productIdList.length == 1 && isHasRechargeIds.length === 1 && isHasDepositlds.length === 0){
|
|
console.log('充值余额商品')
|
|
console.log('充值余额商品')
|
|
productIdList.forEach(item =>{
|
|
productIdList.forEach(item =>{
|
|
- productID += item +','
|
|
|
|
|
|
+ productIds += item +','
|
|
})
|
|
})
|
|
}else if(!isGoods && isHasRechargeIds.length === 0 && isHasDepositlds.length === 0){
|
|
}else if(!isGoods && isHasRechargeIds.length === 0 && isHasDepositlds.length === 0){
|
|
console.log('正常商品')
|
|
console.log('正常商品')
|
|
productIdList.forEach(item =>{
|
|
productIdList.forEach(item =>{
|
|
- productID += item +','
|
|
|
|
|
|
+ productIds += item +','
|
|
})
|
|
})
|
|
}else{
|
|
}else{
|
|
this.$util.modal('提示','缴纳订金商品或余额充值商品请单独下单!','确定','',false,() =>{})
|
|
this.$util.modal('提示','缴纳订金商品或余额充值商品请单独下单!','确定','',false,() =>{})
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- let cartPramsData={
|
|
|
|
- clubId:this.clubId,
|
|
|
|
- allPrice:this.allPrice,
|
|
|
|
- allCount:this.allCount,
|
|
|
|
- productID:productID.substring(0,productID.lastIndexOf(',')),
|
|
|
|
- productCount:''
|
|
|
|
- }
|
|
|
|
|
|
+ let cartPramsData={ productIds:productIds.substring(0,productIds.lastIndexOf(',')) }
|
|
this.$api.navigateTo(`/pages/seller/order/create-order?data=${JSON.stringify({data:cartPramsData})}`)
|
|
this.$api.navigateTo(`/pages/seller/order/create-order?data=${JSON.stringify({data:cartPramsData})}`)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -754,16 +767,16 @@
|
|
deleteList(){//删除购物车商品
|
|
deleteList(){//删除购物车商品
|
|
this.delGoodsList=[];
|
|
this.delGoodsList=[];
|
|
this.goodsList.forEach(delitem=>{
|
|
this.goodsList.forEach(delitem=>{
|
|
- let products = delitem.productsList
|
|
|
|
|
|
+ let products = delitem.cartList
|
|
products.forEach(pros=>{
|
|
products.forEach(pros=>{
|
|
- if(pros.productsChecked){
|
|
|
|
- this.delGoodsList += pros.sellerCartId+','
|
|
|
|
|
|
+ if(pros.isChecked){
|
|
|
|
+ this.delGoodsList += pros.id+','
|
|
}
|
|
}
|
|
})
|
|
})
|
|
})
|
|
})
|
|
this.failureList.forEach(failure=>{
|
|
this.failureList.forEach(failure=>{
|
|
- if(failure.productsChecked){
|
|
|
|
- this.delGoodsList += failure.sellerCartId+','
|
|
|
|
|
|
+ if(failure.isChecked){
|
|
|
|
+ this.delGoodsList += failure.id+','
|
|
}
|
|
}
|
|
})
|
|
})
|
|
if(this.delGoodsList.length == 0){
|
|
if(this.delGoodsList.length == 0){
|
|
@@ -771,7 +784,12 @@
|
|
return
|
|
return
|
|
}else{
|
|
}else{
|
|
this.$util.modal('','确定删除选中的商品吗?','确定','取消',true,() =>{
|
|
this.$util.modal('','确定删除选中的商品吗?','确定','取消',true,() =>{
|
|
- this.SellerService.DeleteSellerCart({sellerCartIds:this.delGoodsList}).then(response =>{
|
|
|
|
|
|
+ this.SellerService.DeleteSellerCart(
|
|
|
|
+ {
|
|
|
|
+ cartIds:this.delGoodsList,
|
|
|
|
+ serviceProviderId:this.listQuery.serviceProviderId
|
|
|
|
+ }
|
|
|
|
+ ).then(response =>{
|
|
this.$util.msg('删除成功',2000);
|
|
this.$util.msg('删除成功',2000);
|
|
setTimeout(()=>{
|
|
setTimeout(()=>{
|
|
this.isshowDelbtn = false;
|
|
this.isshowDelbtn = false;
|
|
@@ -826,8 +844,8 @@
|
|
onShow(){
|
|
onShow(){
|
|
this.$api.getComStorage('orderUserInfo').then((resolve) =>{
|
|
this.$api.getComStorage('orderUserInfo').then((resolve) =>{
|
|
console.log(resolve)
|
|
console.log(resolve)
|
|
- this.clubId = resolve.clubID
|
|
|
|
- this.againBuyProductIds = resolve.againBuyProductIds
|
|
|
|
|
|
+ this.listQuery.clubId = resolve.clubID ? resolve.clubID : 0
|
|
|
|
+ this.listQuery.againBuyProductIds = resolve.againBuyProductIds ? resolve.againBuyProductIds : ''
|
|
this.initData()
|
|
this.initData()
|
|
})
|
|
})
|
|
}
|
|
}
|