浏览代码

购物车

zhengjinyi 4 年之前
父节点
当前提交
4bcbc912cf

+ 0 - 14
api/cart.js

@@ -8,20 +8,6 @@
 import request from '@/common/config/caimeiApi.js'
 import request from '@/common/config/caimeiApi.js'
 import $reg from '@/common/config/common.js'
 import $reg from '@/common/config/common.js'
 
 
-/**
- *加入购物车
- */
-export function shoppingAddCart(params) {
-	return new Promise(function(resolve,reject) {
-		request.post('/shoppingCart/addCart',params, true,res => {
-			if(res.code == 0){
-				resolve(res)
-			}else{
-				reject(res)
-			}
-		})
-	})
-}
 /**
 /**
  *获取购物车列表
  *获取购物车列表
  */
  */

+ 2 - 2
common/config/config.js

@@ -2,8 +2,8 @@ let URL_CONFIG = ""
 if(process.env.NODE_ENV === 'development'){
 if(process.env.NODE_ENV === 'development'){
     // 开发环境
     // 开发环境
 	// URL_CONFIG = 'http://192.168.2.56:8008'	 //本地IP联调地址
 	// URL_CONFIG = 'http://192.168.2.56:8008'	 //本地IP联调地址
-	URL_CONFIG = 'http://192.168.2.67:8008'	 //裴裴联调地址
-	// URL_CONFIG = 'http://192.168.2.75:8008'	 //超超联调地址
+	// URL_CONFIG = 'http://192.168.2.67:8008'	 //裴裴联调地址
+	URL_CONFIG = 'http://192.168.2.75:8008'	 //超超联调地址
     // URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
     // URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
 	// URL_CONFIG = 'https://spi.caimei365.com'
 	// URL_CONFIG = 'https://spi.caimei365.com'
 }else{
 }else{

+ 3 - 3
components/cm-module/productDetails/cm-price.vue

@@ -25,7 +25,7 @@
 		<template v-else>
 		<template v-else>
 			<view   v-if="userIdentity == 1" class="wrap-main-price">
 			<view   v-if="userIdentity == 1" class="wrap-main-price">
 				<view class="p-main">
 				<view class="p-main">
-					<view class="p-price tui-skeleton-fillet">
+					<view class="p-price tui-skeleton-fillet" :class="product.promotions.type == 1 && product.promotions.mode==1 ? 'none' : ''">
 						<text class="txt sm">¥</text>
 						<text class="txt sm">¥</text>
 						<text class="txt big">{{retailPrice | NumFormat}}</text>
 						<text class="txt big">{{retailPrice | NumFormat}}</text>
 					</view>
 					</view>
@@ -41,7 +41,7 @@
 				</view>
 				</view>
 				<view  v-if="product.price1TextFlag == '0'" class="wrap-main-price">
 				<view  v-if="product.price1TextFlag == '0'" class="wrap-main-price">
 					<view class="p-main">
 					<view class="p-main">
-						<view class="p-price tui-skeleton-fillet">
+						<view class="p-price tui-skeleton-fillet" :class="product.promotions.type == 1 && product.promotions.mode==1 ? 'none' : ''">
 							<text class="txt sm">¥</text>
 							<text class="txt sm">¥</text>
 							<text class="txt big">{{retailPrice | NumFormat}}</text>
 							<text class="txt big">{{retailPrice | NumFormat}}</text>
 						</view>
 						</view>
@@ -55,7 +55,7 @@
 				</view>
 				</view>
 				<view v-else class="wrap-main-price">
 				<view v-else class="wrap-main-price">
 					<view class="p-main">
 					<view class="p-main">
-						<view class="p-price tui-skeleton-fillet">
+						<view class="p-price tui-skeleton-fillet" :class="product.promotions.type == 1 && product.promotions.mode==1 ? 'none' : ''">
 							<text class="txt sm">¥</text>
 							<text class="txt sm">¥</text>
 							<text class="txt big">{{retailPrice | NumFormat}}</text>
 							<text class="txt big">{{retailPrice | NumFormat}}</text>
 						</view>
 						</view>

+ 3 - 3
pages/goods/cart.vue

@@ -128,7 +128,7 @@
 	import headerNavbar from "@/components/cm-module/headerNavbar/headerNavbar.vue" //顶部自定义胶囊'
 	import headerNavbar from "@/components/cm-module/headerNavbar/headerNavbar.vue" //顶部自定义胶囊'
 	import modalLayer from "@/components/modal-layer"
 	import modalLayer from "@/components/modal-layer"
 	import { mapState,mapMutations } from 'vuex';
 	import { mapState,mapMutations } from 'vuex';
-	import { queryShoppingCartList,shoppingCartUpdate,shoppingCartDelete } from "@/api/cart.js" 
+	import { shoppingCartUpdate,shoppingCartDelete } from "@/api/cart.js" 
 	
 	
 	export default{
 	export default{
 		components:{
 		components:{
@@ -222,7 +222,7 @@
 			},
 			},
 			initGetCartGoodsList(){//初始化购物车 index:1
 			initGetCartGoodsList(){//初始化购物车 index:1
 				let params = {userID:this.userID}
 				let params = {userID:this.userID}
-				queryShoppingCartList(params).then(response =>{
+				this.ProductService.queryShoppingCartList(params).then(response =>{
 					this.skeletonShow = false
 					this.skeletonShow = false
 					this.$store.commit('updateAllNum',response.data.cartQuantity)
 					this.$store.commit('updateAllNum',response.data.cartQuantity)
 					const responseData = response.data
 					const responseData = response.data
@@ -274,7 +274,7 @@
 			getOnReachBottomData(){//上拉加载
 			getOnReachBottomData(){//上拉加载
 				this.pageNum+=1
 				this.pageNum+=1
 				let params = {userID:this.userID,pageNum:this.pageNum,pageSize:this.pageSize}
 				let params = {userID:this.userID,pageNum:this.pageNum,pageSize:this.pageSize}
-				queryShoppingCartList(params).then(response =>{
+				this.ProductService.queryShoppingCartList(params).then(response =>{
 					let resultsData = response.data.pageDate
 					let resultsData = response.data.pageDate
 					this.hasNextPage = resultsData.hasNextPage;
 					this.hasNextPage = resultsData.hasNextPage;
 					this.goodsList = this.goodsList.concat(resultsData.results)
 					this.goodsList = this.goodsList.concat(resultsData.results)

+ 8 - 5
pages/goods/product.vue

@@ -195,7 +195,6 @@
 	import cmParameter from "@/components/cm-module/productDetails/cm-parameter" //相关参数
 	import cmParameter from "@/components/cm-module/productDetails/cm-parameter" //相关参数
 	import cmService from "@/components/cm-module/productDetails/cm-service" //服务项目
 	import cmService from "@/components/cm-module/productDetails/cm-service" //服务项目
 	import wxLogin from "@/common/config/wxLogin.js"
 	import wxLogin from "@/common/config/wxLogin.js"
-	import { shoppingAddCart } from "@/api/cart.js" 
 	var isPreviewImg;
 	var isPreviewImg;
 	export default{
 	export default{
 		components:{
 		components:{
@@ -485,7 +484,7 @@
 				}, 200);
 				}, 200);
 			},
 			},
 			getAddProductCart(){//增加购物车成功和toast弹窗提示成功	
 			getAddProductCart(){//增加购物车成功和toast弹窗提示成功	
-				shoppingAddCart({productID:this.productID,userID:this.userID,productCount:this.number}).then(response => {
+				this.ProductService.shoppingAddCart({productID:this.productID,userID:this.userID,productCount:this.number}).then(response => {
 					this.specClass = 'hide';
 					this.specClass = 'hide';
 					this.$util.msg('加入购物车成功',1500,true,'success')
 					this.$util.msg('加入购物车成功',1500,true,'success')
 					this.isAnimation = true
 					this.isAnimation = true
@@ -733,8 +732,13 @@
 				height: 44rpx;
 				height: 44rpx;
 				line-height: 44rpx;
 				line-height: 44rpx;
 				float: left;
 				float: left;
+				color: #FF2A2A;
+				&.none{
+					text-decoration: line-through;
+					color: #999999;
+					
+				}
 				.txt{
 				.txt{
-					color: #FF2A2A;
 					margin:0 2rpx;
 					margin:0 2rpx;
 				}
 				}
 				.txt.sm{
 				.txt.sm{
@@ -759,7 +763,7 @@
 				float: right;
 				float: right;
 				padding: 0 18rpx;
 				padding: 0 18rpx;
 				border-radius: 22rpx;
 				border-radius: 22rpx;
-				background-color: #EBEBEB;
+				background-color: #f7f7f7;
 				color: #7F7F7F;
 				color: #7F7F7F;
 				font-size: 24rpx;
 				font-size: 24rpx;
 				text-align: center;
 				text-align: center;
@@ -832,7 +836,6 @@
 			float: left;
 			float: left;
 			width: 100%;
 			width: 100%;
 			box-sizing: border-box;
 			box-sizing: border-box;
-			margin-top: 10rpx;
 		}
 		}
 		.wrap-info{
 		.wrap-info{
 			float: left;
 			float: left;

+ 1 - 2
pages/goods/secondProduct.vue

@@ -96,7 +96,6 @@
 	import secondDeatail from "@/components/cm-module/productDetails/secondDeatail" // 商品信息
 	import secondDeatail from "@/components/cm-module/productDetails/secondDeatail" // 商品信息
 	import secondBrand from "@/components/cm-module/productDetails/secondBrand" // 品牌信息
 	import secondBrand from "@/components/cm-module/productDetails/secondBrand" // 品牌信息
 	import wxLogin from "@/common/config/wxLogin.js"
 	import wxLogin from "@/common/config/wxLogin.js"
-	import { shoppingAddCart } from "@/api/cart.js" 
 	var isPreviewImg;
 	var isPreviewImg;
 	export default{
 	export default{
 		components:{
 		components:{
@@ -381,7 +380,7 @@
 				}, 200);
 				}, 200);
 			},
 			},
 			getAddProductCart(){//增加购物车成功和toast弹窗提示成功	
 			getAddProductCart(){//增加购物车成功和toast弹窗提示成功	
-				shoppingAddCart({productID:this.productID,userID:this.userID,productCount:this.number}).then(response => {
+				this.ProductService.shoppingAddCart({productID:this.productID,userID:this.userID,productCount:this.number}).then(response => {
 					this.specClass = 'hide';
 					this.specClass = 'hide';
 					this.$util.msg('加入购物车成功',1500,true,'success')
 					this.$util.msg('加入购物车成功',1500,true,'success')
 					this.isAnimation = true
 					this.isAnimation = true

+ 38 - 72
pages/tabBar/cart/cart.vue

@@ -17,7 +17,7 @@
 								<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)" :class="[pros.validFlag == '3' && !isshowDelbtn ?'disabled' : '']">
 										<view class="checkbox-box" @click.stop="ischeck(item,pros)" :class="[pros.validFlag == '3' && !isshowDelbtn ?'disabled' : '']">
@@ -26,7 +26,7 @@
 													:class="[pros.productsChecked ?'icon-gouxuanl':'icon-weigouxuan']">
 													:class="[pros.productsChecked ?'icon-gouxuanl':'icon-weigouxuan']">
 											</button>
 											</button>
 										</view>
 										</view>
-										<view class="pros-img" @click.stop="navToListPage(pros.productID)"	><image :src="pros.mainImage ? pros.mainImage:''" alt="" /></view>
+										<view class="pros-img" @click.stop="navToListPage(pros.productID)"	><image :src="pros.image ? pros.image:''" alt="" /></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)"	>
 												<text v-if="pros.validFlag == '3'" class="no-text">商品已下架</text>{{pros.name}}
 												<text v-if="pros.validFlag == '3'" class="no-text">商品已下架</text>{{pros.name}}
@@ -36,14 +36,14 @@
 												<!--使用过滤器对总价改变-->
 												<!--使用过滤器对总价改变-->
 												<view class="price" :class="[pros.validFlag == '3' ?'disabled' : '']">
 												<view class="price" :class="[pros.validFlag == '3' ?'disabled' : '']">
 													<text :class="[pros.validFlag == '3' ?'disabled' : 'money-sign']">¥</text>
 													<text :class="[pros.validFlag == '3' ?'disabled' : 'money-sign']">¥</text>
-													{{pros.retailPrice?pros.retailPrice.toFixed(2):''}}
+													{{pros.price | NumFormat}}
 												</view>
 												</view>
 												<view class="count" v-if="pros.validFlag == '2'"  :class="[isshowDelbtn ? 'none':'show']">
 												<view class="count" v-if="pros.validFlag == '2'"  :class="[isshowDelbtn ? 'none':'show']">
-													<text class="count-tips" v-if="pros.productCount<pros.minBuyNumber">起订量:{{pros.minBuyNumber}}</text>
+													<text class="count-tips" v-if="pros.number<pros.minBuyNumber">起订量:{{pros.minBuyNumber}}</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" :class="[pros.validFlag == '3'?'disabled':'']" @click="changeCountSub(item,pros)"></view>
 														<view  class="iconfont icon-jianhao" :class="[pros.validFlag == '3'?'disabled':'']" @click="changeCountSub(item,pros)"></view>
-														<input class="btn-input" type="number" maxlength='4' v-model="pros.productCount" @blur="changeNnmber($event,item,pros)" @focus="changeInput(pros)">
+														<input class="btn-input" type="number" maxlength='4' v-model="pros.number" @blur="changeNnmber($event,item,pros)" @focus="changeInput(pros)">
 														<view  class="iconfont icon-jiahao"  :class="[pros.validFlag == '3'?'disabled':'']" @click="changeCountAdd(item,pros)"></view>
 														<view  class="iconfont icon-jiahao"  :class="[pros.validFlag == '3'?'disabled':'']" @click="changeCountAdd(item,pros)"></view>
 													</view>
 													</view>
 												</view>
 												</view>
@@ -126,7 +126,7 @@
 	import tuiNomore from "@/components/tui-components/nomore/nomore"
 	import tuiNomore from "@/components/tui-components/nomore/nomore"
 	import modalLayer from "@/components/modal-layer"
 	import modalLayer from "@/components/modal-layer"
 	import { mapState,mapMutations } from 'vuex';
 	import { mapState,mapMutations } from 'vuex';
-	import { queryShoppingCartList,shoppingCartUpdate,shoppingCartDelete } from "@/api/cart.js" 
+	import { shoppingCartUpdate,shoppingCartDelete } from "@/api/cart.js" 
 	
 	
 	export default{
 	export default{
 		components:{
 		components:{
@@ -169,6 +169,11 @@
 		onLoad(){
 		onLoad(){
 			this.setScrollHeight();
 			this.setScrollHeight();
 		},
 		},
+		filters: {
+			NumFormat:function(text) {//处理金额
+				return Number(text).toFixed(2);
+			},
+		},
 		computed: {
 		computed: {
 			...mapState(['hasLogin','userInfo'])
 			...mapState(['hasLogin','userInfo'])
 		},
 		},
@@ -211,18 +216,17 @@
 				}, 500)
 				}, 500)
 			},
 			},
 			initGetCartGoodsList(){//初始化购物车 index:1
 			initGetCartGoodsList(){//初始化购物车 index:1
-				let params = {userID:this.userID}
-				queryShoppingCartList(params).then(response =>{
+				this.ProductService.queryShoppingCartList({userId:this.userID}).then(response =>{
 					this.skeletonShow = false
 					this.skeletonShow = false
-					this.$store.commit('updateAllNum',response.data.cartQuantity)
-					const responseData = response.data
-					if(responseData.pageDate.length > 0 || responseData.failureList.length > 0){
+					let data = response.data
+					this.$store.commit('updateAllNum',data.kindCount)
+					if( data.list.length > 0 || data.invalid.length > 0){
 						this.isEmpty =false
 						this.isEmpty =false
 					}else{
 					}else{
 						this.isEmpty =true
 						this.isEmpty =true
 					}
 					}
-					if(responseData.pageDate && responseData.pageDate.length > 0 ){
-						this.goodsList = responseData.pageDate;
+					if(data.list && data.list.length > 0 ){
+						this.goodsList = data.list;
 						this.goodsList.forEach((item,index) => {
 						this.goodsList.forEach((item,index) => {
 							let productsListLength = item.productsList.length,
 							let productsListLength = item.productsList.length,
 								invalidLength = 0;
 								invalidLength = 0;
@@ -231,8 +235,8 @@
 								pros.isStep = false
 								pros.isStep = false
 								if(pros.validFlag == '3' ) {invalidLength++;}
 								if(pros.validFlag == '3' ) {invalidLength++;}
 								if(pros.step === 2){ 
 								if(pros.step === 2){ 
-									if(pros.productCount % pros.minBuyNumber != 0){
-										pros.productCount = pros.minBuyNumber
+									if(pros.number % pros.minBuyNumber != 0){
+										pros.number = pros.minBuyNumber
 										this.totalShopPeice()
 										this.totalShopPeice()
 										this.updateShoppogNum(pros)
 										this.updateShoppogNum(pros)
 									}
 									}
@@ -261,44 +265,6 @@
 					this.$util.msg(error.msg,2000);
 					this.$util.msg(error.msg,2000);
 				})
 				})
 			},		
 			},		
-			getOnReachBottomData(){//上拉加载
-				this.pageNum+=1
-				let params = {userID:this.userID,pageNum:this.pageNum,pageSize:this.pageSize}
-				queryShoppingCartList(params).then(response =>{
-					let resultsData = response.data.pageDate
-					this.hasNextPage = resultsData.hasNextPage;
-					this.goodsList = this.goodsList.concat(resultsData.results)
-					this.goodsList.forEach((item,index) => {
-						let productsListLength = item.productsList.length,
-							invalidLength = 0;
-						item.productsList.forEach(pros => {
-							pros.shopID = item.shopID;
-							pros.isStep = false
-							if(pros.validFlag == '3' ) {invalidLength++;}
-							if(pros.step === 2){ 
-								if(pros.productCount % pros.minBuyNumber != 0){
-									pros.productCount = pros.minBuyNumber
-									this.totalShopPeice()
-									this.updateShoppogNum(pros)
-								}
-							}
-						})
-						item.isDisabled = invalidLength === productsListLength;
-					})
-					this.pullFlag = false;// 防上拉暴滑
-					setTimeout(()=>{this.pullFlag = true;},500)
-					if(this.hasNextPage){
-						this.pullUpOn = false
-						this.nomoreText = '上拉显示更多'
-					}else{
-						this.loadding = false
-						this.pullUpOn = false
-						this.nomoreText = '已至底部'
-					}
-				}).catch(error =>{
-					this.$util.msg(error.msg,2000);
-				})
-			},
 			ischeckFailure(failure){
 			ischeckFailure(failure){
 				failure.productsChecked = !failure.productsChecked
 				failure.productsChecked = !failure.productsChecked
 				this.updateCheckAllBtn()
 				this.updateCheckAllBtn()
@@ -401,11 +367,11 @@
 				let productsList=[];
 				let productsList=[];
 				this.goodsList.map((item,index)=>{
 				this.goodsList.map((item,index)=>{
 					productsList=item.productsList;
 					productsList=item.productsList;
-					prosPrice=productsList.reduce((p,e)=>p+e.retailPrice*e.productCount,0);
+					prosPrice=productsList.reduce((p,e)=>p+e.retailPrice*e.number,0);
 					productsList.forEach(pros =>{
 					productsList.forEach(pros =>{
 						if(pros.validFlag =='3'){
 						if(pros.validFlag =='3'){
 							validList.push(pros)
 							validList.push(pros)
-							validPrice = validList.reduce((p,e)=>p+e.retailPrice*e.productCount,0);
+							validPrice = validList.reduce((p,e)=>p+e.retailPrice*e.number,0);
 							item.totalPrice = prosPrice - validPrice
 							item.totalPrice = prosPrice - validPrice
 						}else{
 						}else{
 							item.totalPrice = prosPrice
 							item.totalPrice = prosPrice
@@ -423,10 +389,10 @@
 					productsList=item.productsList;
 					productsList=item.productsList;
 					productsList.forEach(pros=>{	
 					productsList.forEach(pros=>{	
 						if(pros.productsChecked){
 						if(pros.productsChecked){
-							prosPrice+=pros.retailPrice*pros.productCount;
+							prosPrice+=pros.retailPrice*pros.number;
 							if(pros.validFlag =='3'){
 							if(pros.validFlag =='3'){
 								validList.push(pros)
 								validList.push(pros)
-								validPrice = validList.reduce((p,e)=>p+e.retailPrice*e.productCount,0);
+								validPrice = validList.reduce((p,e)=>p+e.retailPrice*e.number,0);
 								this.allPrice = prosPrice - validPrice
 								this.allPrice = prosPrice - validPrice
 							}else{
 							}else{
 								this.allPrice = prosPrice
 								this.allPrice = prosPrice
@@ -445,11 +411,11 @@
 					productsList = item.productsList
 					productsList = item.productsList
 					productsList.forEach(pros=>{
 					productsList.forEach(pros=>{
 						if(pros.productsChecked){
 						if(pros.productsChecked){
-							prosAllCount+=parseInt(pros.productCount);
+							prosAllCount+=parseInt(pros.number);
 							if(pros.validFlag =='3'){
 							if(pros.validFlag =='3'){
 								validList.push(pros)
 								validList.push(pros)
 								validList.forEach(val =>{
 								validList.forEach(val =>{
-									validCount += val.productCount
+									validCount += val.number
 								})
 								})
 								this.allCount = prosAllCount - validCount
 								this.allCount = prosAllCount - validCount
 							}else{
 							}else{
@@ -462,11 +428,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.minBuyNumber
 					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
 				}
 				}
@@ -474,16 +440,16 @@
 				this.totalShopPeice();
 				this.totalShopPeice();
 			},
 			},
 			changeCountSub(item,pros){//商品数量减减
 			changeCountSub(item,pros){//商品数量减减
-				if(pros.productCount<=pros.minBuyNumber){
-					pros.productCount= pros.minBuyNumber
+				if(pros.number<=pros.minBuyNumber){
+					pros.number= pros.minBuyNumber
 					this.$util.msg(`该商品最小起订量为${pros.minBuyNumber}`,2000);
 					this.$util.msg(`该商品最小起订量为${pros.minBuyNumber}`,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.minBuyNumber
 					}else{
 					}else{
-						pros.productCount--
+						pros.number--
 					}
 					}
 					this.processActivityPrice(pros)
 					this.processActivityPrice(pros)
 				}
 				}
@@ -497,16 +463,16 @@
 				
 				
 				let _value = Number(e.detail.value);
 				let _value = Number(e.detail.value);
 				if(!this.$api.isNumber(_value)){
 				if(!this.$api.isNumber(_value)){
-					pros.productCount = pros.minBuyNumber
+					pros.number = pros.minBuyNumber
 				}else if(_value < pros.minBuyNumber){	
 				}else if(_value < pros.minBuyNumber){	
 					this.$util.msg(`该商品最小起订量为${pros.minBuyNumber}`,2000);
 					this.$util.msg(`该商品最小起订量为${pros.minBuyNumber}`,2000);
-					pros.productCount = pros.minBuyNumber
+					pros.number = pros.minBuyNumber
 				}else if(_value % pros.minBuyNumber != 0){
 				}else if(_value % pros.minBuyNumber != 0){
 					pros.isStep = true
 					pros.isStep = true
-					pros.productCount = pros.minBuyNumber
+					pros.number = pros.minBuyNumber
 				}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)
@@ -518,14 +484,14 @@
 					pros.retailPrice = pros.retailPrice
 					pros.retailPrice = pros.retailPrice
 				}else{
 				}else{
 					ladderPriceList.forEach((item,index)=>{
 					ladderPriceList.forEach((item,index)=>{
-						if(pros.productCount>=item.buyNum){
+						if(pros.number>=item.buyNum){
 							pros.retailPrice = item.buyPrice
 							pros.retailPrice = item.buyPrice
 						}
 						}
 					})
 					})
 				}
 				}
 			},
 			},
 			updateShoppogNum(pros){//加减购物车商品更新到后台
 			updateShoppogNum(pros){//加减购物车商品更新到后台
-				let params ={userID:this.userID,productID:pros.productID,productCount:pros.productCount}
+				let params ={userID:this.userID,productID:pros.productID,productCount:pros.number}
 				shoppingCartUpdate(params).then(response =>{
 				shoppingCartUpdate(params).then(response =>{
 					this.isshowDelbtn = false;
 					this.isshowDelbtn = false;
 					this.initGetCartGoodsList();
 					this.initGetCartGoodsList();
@@ -551,7 +517,7 @@
 					this.goodsList.forEach(el=>{
 					this.goodsList.forEach(el=>{
 						el.productsList.forEach(pros=>{
 						el.productsList.forEach(pros=>{
 							if(pros.productsChecked){
 							if(pros.productsChecked){
-							   if(pros.productCount<pros.minBuyNumber){
+							   if(pros.number<pros.minBuyNumber){
 								   this.isNoConfim = true
 								   this.isNoConfim = true
 							   }
 							   }
 							}
 							}

+ 6 - 4
pages/tabBar/home/home.vue

@@ -248,19 +248,21 @@
 							if(response.data.userIdentity ==1){
 							if(response.data.userIdentity ==1){
 								this.$api.navigateTo('/seller/pages/index/index')
 								this.$api.navigateTo('/seller/pages/index/index')
 							}
 							}
+							this.getHomeInformation()
+							this.getOrganizeProducts()
 						}).catch(error =>{
 						}).catch(error =>{
 							this.isLogin = false;
 							this.isLogin = false;
 							this.logout()
 							this.logout()
 							uni.removeStorageSync('sessionid')
 							uni.removeStorageSync('sessionid')
 							uni.setStorageSync('sessionid','JSESSIONID='+error.data)
 							uni.setStorageSync('sessionid','JSESSIONID='+error.data)
 							this.$store.commit('updateStatus',error.data)
 							this.$store.commit('updateStatus',error.data)
+							this.getHomeInformation()
+							this.getOrganizeProducts()
 						})
 						})
-						this.getHomeInformation()
-						this.getOrganizeProducts()
 					})
 					})
 				})
 				})
 			},		
 			},		
-			getHomeInformation(){		
+			getHomeInformation(){//初始化首页数据	
 				queryHomeInfo({}).then(res =>{
 				queryHomeInfo({}).then(res =>{
 					let data = res.data;
 					let data = res.data;
 					this.bannerImageList = data.bannerImageList
 					this.bannerImageList = data.bannerImageList
@@ -271,7 +273,6 @@
 					this.secondModulesImage= data.secondModulesImage
 					this.secondModulesImage= data.secondModulesImage
 					this.thirdModulesName= data.thirdModulesName
 					this.thirdModulesName= data.thirdModulesName
 					this.productsClassifyList = data.productsClassifyList
 					this.productsClassifyList = data.productsClassifyList
-					this.skeletonShow = false;
 					this.$store.commit('updateAllNum',data.shoppingCartCount)
 					this.$store.commit('updateAllNum',data.shoppingCartCount)
 				}).catch(error =>{
 				}).catch(error =>{
 					this.$util.msg(error.msg,2000)
 					this.$util.msg(error.msg,2000)
@@ -294,6 +295,7 @@
 				productIds = productIdArr.join(",");
 				productIds = productIdArr.join(",");
 				this.ProductService.querySearchProductPrice({userId: this.userID,productIds:productIds}).then(response =>{
 				this.ProductService.querySearchProductPrice({userId: this.userID,productIds:productIds}).then(response =>{
 					this.organizeProducts = this.ReturnNewProducts(this.organizeProducts,response.data);
 					this.organizeProducts = this.ReturnNewProducts(this.organizeProducts,response.data);
+					this.skeletonShow = false;
 				}).catch(error =>{
 				}).catch(error =>{
 					this.$util.msg(error.msg,2000)
 					this.$util.msg(error.msg,2000)
 				})
 				})

+ 1 - 2
pages/user/regularPurchase/regularPurchase.vue

@@ -38,7 +38,6 @@
 
 
 <script>
 <script>
 	import productList from '@/components/cm-module/listTemplate/productList'
 	import productList from '@/components/cm-module/listTemplate/productList'
-	import { shoppingAddCart } from "@/api/cart.js" 
 	export default{
 	export default{
 		components:{
 		components:{
 			productList
 			productList
@@ -145,7 +144,7 @@
 				}, 200);
 				}, 200);
 			},
 			},
 			getAddProductCart(){//增加购物车成功和toast弹窗提示成功
 			getAddProductCart(){//增加购物车成功和toast弹窗提示成功
-				shoppingAddCart({productID:this.handleData.productID,userID:this.userID,productCount:this.number}).then(response => {
+				this.ProductService.shoppingAddCart({productID:this.handleData.productID,userID:this.userID,productCount:this.number}).then(response => {
 					this.specClass = 'hide';
 					this.specClass = 'hide';
 					this.$util.msg(response.msg,1500,true,'success')
 					this.$util.msg(response.msg,1500,true,'success')
 					setTimeout(() => {this.specClass = 'none'}, 200)
 					setTimeout(() => {this.specClass = 'none'}, 200)

+ 0 - 1
seller/pages/cart/buyagain.vue

@@ -40,7 +40,6 @@
 
 
 <script>
 <script>
 	import buyagainList from '@/components/cm-module/listTemplate/buyagainList'
 	import buyagainList from '@/components/cm-module/listTemplate/buyagainList'
-	import { shoppingAddCart } from "@/api/cart.js" 
 	import { getSellerProductNum,shoppingCartAddCart } from "@/api/seller.js" 
 	import { getSellerProductNum,shoppingCartAddCart } from "@/api/seller.js" 
 	export default{
 	export default{
 		components:{
 		components:{

+ 2 - 2
services/ajax.env.js

@@ -2,8 +2,8 @@ let URL_CONFIG = ""
 if(process.env.NODE_ENV === 'development'){
 if(process.env.NODE_ENV === 'development'){
     // 开发环境
     // 开发环境
 	// URL_CONFIG = 'http://192.168.2.56:8008'	 //俊俊联调地址
 	// URL_CONFIG = 'http://192.168.2.56:8008'	 //俊俊联调地址
-	URL_CONFIG = 'http://192.168.2.67:8008'	 //裴裴联调地址
-	// URL_CONFIG = 'http://192.168.2.75:8008'	 //超超联调地址
+	// URL_CONFIG = 'http://192.168.2.67:8008'	 //裴裴联调地址
+	URL_CONFIG = 'http://192.168.2.75:8008'	 //超超联调地址
     // URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
     // URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
 	// URL_CONFIG = 'https://spi.caimei365.com'
 	// URL_CONFIG = 'https://spi.caimei365.com'
 }else{
 }else{

+ 16 - 6
services/product.service.js

@@ -14,7 +14,7 @@ export default class ProductService {
 	 * @param:pageSize 每页条数
 	 * @param:pageSize 每页条数
 	 */
 	 */
 	queryProductPreferred (data = {}) {
 	queryProductPreferred (data = {}) {
-		return this.AjaxService.get({ url:'/product/preferred', data, isLoading: false })
+		return this.AjaxService.get({ url:'/product/preferred', data, isLoading: true })
 	}
 	}
 	/**
 	/**
 	 * @商品列表-查询商品价格
 	 * @商品列表-查询商品价格
@@ -32,10 +32,20 @@ export default class ProductService {
 	queryProductDetils (data = {}) {
 	queryProductDetils (data = {}) {
 		return this.AjaxService.get({ url:'/product/details', data, isLoading: false })
 		return this.AjaxService.get({ url:'/product/details', data, isLoading: false })
 	}
 	}
-
-	/* 余额抵扣 orderId 订单ID */
-	OrderBalanceDeduction (data = {}) {
-		return this.AjaxService.post({ url:'/order/balanceDeduction', data, isLoading: false })
+	/**
+	 * @加入购物车
+	 * @param:userId 用户ID(必填)
+	 * @param:productID 用户ID(必填)
+	 * @param:productCount 商品数量(必填)
+	 */
+	shoppingAddCart (data = {}) {
+		return this.AjaxService.post({ url:'/shoppingCart/addCart', data, isLoading: true })
+	}
+	/**
+	 * @购物车列表
+	 * @param:userId 用户ID(必填)
+	 */
+	queryShoppingCartList (data = {}) {
+		return this.AjaxService.get({ url:'/shoppingCart/list', data, isLoading: false })
 	}
 	}
-	
 }
 }

+ 1 - 1
supplier/pages/deliver/logistics-list.vue

@@ -9,7 +9,7 @@
 <script>
 <script>
 	import authorize from '@/common/config/authorize.js'
 	import authorize from '@/common/config/authorize.js'
 	import { mapState,mapMutations } from 'vuex';
 	import { mapState,mapMutations } from 'vuex';
-	import { queryShoppingCartList,shoppingCartUpdate,shoppingCartDelete } from "@/api/cart.js" 
+	import { shoppingCartUpdate,shoppingCartDelete } from "@/api/cart.js" 
 	
 	
 	export default{
 	export default{
 		data(){
 		data(){