Sfoglia il codice sorgente

commit -m 商品模块联调

zhengjinyi 4 anni fa
parent
commit
88ca38af84

+ 23 - 15
components/cm-module/listTemplate/buyagainList.vue

@@ -3,21 +3,21 @@
 		<list-skeleton v-if="showSkeleton"></list-skeleton>
 		<view class="product-container" v-if="!isShowEmpty" :style="{paddingTop:searchStatus?'112rpx':''}">
 			<scroll-view :style="{'height':scrollHeight+'px'}" @scrolltolower="scrolltolower" scroll-y v-if="productList.length > 0">
-				<view v-for="(item,index) in productList" :key="index" :id="item.id" class="all-type-list-content commodity-list" @click.stop="navToDetailPage(item.productID)">
+				<view v-for="(item,index) in productList" :key="index" :id="item.productId" 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 !=null ? item.unit : ''}}</text>
-						<text class="list-details-miniQuantity">起订量:{{item.ladderPriceFlag == '1' ? item.maxBuyNumber : item.minBuyNumber}}</text>
+						<text class="list-details-miniQuantity">起订量:{{item.ladderPriceFlag == 1 ? item.maxBuyNumber : item.minBuyNumber}}</text>
 						<view class="list-details-price">
 							<view class="list-shop">
 								<view class="list-price-none" v-if="item.repurchasePriceState">
-									<text class="price-none">¥{{item.discountPrice}}</text>
+									<text class="price-none">¥{{item.originalPrice}}</text>
 									<text class="iconfont icon-wenhao" @click.stop="repurchModel"></text>
 								</view>
 								<view class="list-price" v-else>
 									<text class="price-larger" :class="PromotionsFormat(item.promotions) ? 'none' : ''">
-										¥{{ (PromotionsFormat(item.promotions) ? item.price1 : item.retailPrice) | NumFormat }}
+										¥{{ (PromotionsFormat(item.promotions) ? item.originalPrice : item.price) | NumFormat }}
 									</text>
 								</view>
 							</view>
@@ -26,7 +26,7 @@
 						<view class="list-details-price" v-if="item.actStatus==1">
 							<view class="floor-item-act">
 								<view class="floor-tags" v-if="PromotionsFormat(item.promotions)">
-									{{item.promotions.name}}<text>:¥{{ item.retailPrice | NumFormat }}</text>
+									{{item.promotions.name}}<text>:¥{{ item.price | NumFormat }}</text>
 								</view>
 								<view class="floor-tags" v-else>{{item.promotions.name}}</view>	
 							</view>
@@ -81,7 +81,7 @@
 				windowHeight: '',
 				showSkeleton: true,
 				isShowEmpty: false,
-				userID: '',
+				userId: '',
 				scrollHeight: '',
 				productList: [],
 				showLoading: false,
@@ -103,7 +103,7 @@
 			this.setScrollHeight();		
 			this.$parent.getClubProductNum()
 			this.$api.getComStorage('orderUserInfo').then((resolve) =>{
-				this.userID = resolve.userID
+				this.userId = resolve.userID
 				this.getProductAgainInfo()
 			})
 		},
@@ -132,18 +132,24 @@
 				this.loadingText = '加载中';
 				this.isShowEmpty = false;				
 				if(loadMore) {this.pageNum += 1;}
-				let params = {userId:this.userID,pageNum:this.pageNum,pageSize:this.pageSize}
-				this.ProductService.GetRepeatBuyAgainProductList(params).then(response =>{
+				this.ProductService.GetRepeatBuyAgainProductList(
+					{
+						userId:this.userId,
+						pageNum:this.pageNum,
+						pageSize:this.pageSize,
+					}
+				)
+				.then(response =>{
 					this.isShowWrapper = true
-					const responseData = response.data.pageDate;
-					if(responseData.results && responseData.results.length > 0){
+					this.showSkeleton = false;
+					const listData = response.data.results;
+					if(listData && listData.length > 0){
 						this.hasNextPage = responseData.hasNextPage;
 						this.isShowEmpty = false;
 						if(loadMore) {
-							this.productList = [...this.productList,...responseData.results];
+							this.productList = [...this.productList,...listData];
 						} else {
-							this.productList = [...responseData.results];
-							this.showSkeleton = false;
+							this.productList = [...listData];
 						}
 						//价格显示处理
 						let isActFlg,newProductList=[];
@@ -158,6 +164,7 @@
 							newProductList.push(Object.assign({},item,{isShowActFlg:isActFlg}))
 						})
 						this.productList = newProductList
+						console.log(this.productList)
 						// 防上拉暴滑
 						this.pullFlag = false;
 						setTimeout(()=>{
@@ -175,7 +182,8 @@
 							this.isShowEmpty = true;
 						}
 					}
-				}).catch(error =>{
+				})
+				.catch(error =>{
 					this.$util.msg(error.msg,2000);
 				})
 			},

+ 40 - 21
components/cm-module/listTemplate/immediatelyList.vue

@@ -31,14 +31,14 @@
 		<view class="product-container" v-else >
 			<view :class="tabIndex" v-if="tabIndex === 0"  :style="{paddingTop:searchStatus?'128rpx':''}">
 				<scroll-view :style="{'height':scrollHeight+'px'}" @scrolltolower="scrolltolower(tabIndex)" scroll-y 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.p_id)"  >
-					    <image mode='widthFix' :src="item.p_image"  class="list-img" alt="list-img"></image>
+					<view v-for="(item,index) in listData" :key="index" :id="item.productId" class="all-type-list-content commodity-list" @click.stop="navToDetailPage(item.productId)"  >
+					    <image mode='widthFix' :src="item.image"  class="list-img" alt="list-img"></image>
 						<view class="list-details-info">
-							<text class="list-details-title">{{isInterceptHtmlFn(item.p_name)}}</text>
-							<text class="list-details-specs">规格:{{item.p_unit?item.p_unit:''}}</text>
+							<text class="list-details-title">{{isInterceptHtmlFn(item.name)}}</text>
+							<text class="list-details-specs">规格:{{item.unit ? item.unit : ''}}</text>
 							<text class="list-details-miniQuantity list-details-specs">起订量:{{item.minBuyNumber}}</text>
-							<view class="list-details-specs" v-if="item.p_code!=''&&item.p_code!=null">
-								<view>商品编码:{{item.p_code}}</view>
+							<view class="list-details-specs" v-if="item.code!=''&& item.code!=null">
+								<view>商品编码:{{item.code}}</view>
 							</view>
 							<view class="list-details-price">
 								<template v-if="priceLoading">
@@ -79,19 +79,19 @@
 				<scroll-view :style="{'height':scrollHeight+'px',paddingTop:searchStatus?'112rpx':''}" @scrolltolower="scrolltolower(tabIndex)" scroll-y>
 					<view class="all-zuhe-list" v-for="(item,index) in combinationProduct" :key="index" :id="item.id">
 						<view class="zuhe_title" :class="index%2==0 ? 'active' : ''">{{item.name}}</view>
-						<view v-for="(pros,proIndex) in item.combinationProductList" :class="index%2==0 ? 'stylecontent' : ''" :key="proIndex" :id="pros.productID" class="zuhe-list-content commodity-list" >
+						<view v-for="(pros,proIndex) in item.combinationProductList" :class="index%2==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" @click.stop="navToDetailPage(pros.productID)">{{pros.name}}</text>
+								<text class="list-details-title zuhe_list_text">商品编码:{{pros.code}}</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 com">
 										<view class="list-price zuhe_list_price" >
 											<view class="zuhe_price-larger zuhe_list_text" >
-												<view class="list-price-none" v-if="pros.repurchasePriceState">
-													<text class="price-none">价格:¥{{pros.discountPrice}}</text>
+												<view class="list-price-none" v-if="pros.repurchaseFlag">
+													<text class="price-none">价格:¥{{ pros.originalPrice }}</text>
 													<text class="iconfont icon-wenhao" @click.stop="repurchModel"></text>
 												</view>
-												<view class="price-larger">价格:¥{{ pros.retailPrice | NumFormat }}</view>
+												<view class="price-larger">价格:¥{{ pros.price | NumFormat }}</view>
 											</view>
 											<view class="zuhe_price-larger zuhe_list_text" >
 												<view class="floor-item-act" v-if="pros.actStatus==1">
@@ -257,8 +257,17 @@
 				this.loadingText = '加载中';
 				this.isShowEmpty = false;				
 				if(loadMore) {this.pageNum += 1;}
-				let params = {identity:this.identity,keyword:this.searchInputVal,pageNum:this.pageNum,pageSize:this.pageSize,sortField:'',sortType:''}
-				this.ProductService.GetProductSearchList(params).then(response =>{
+				this.ProductService.GetProductSearchList(
+					{
+						identity:this.identity,
+						keyword:this.searchInputVal,
+						pageNum:this.pageNum,
+						pageSize:this.pageSize,
+						sortField:'',
+						sortType:'',
+					}
+				)
+				.then(response =>{
 					this.isShowWrapper = true
 					const resData = JSON.parse(response.data);
 					const resList = resData.items;
@@ -289,7 +298,8 @@
 							this.isShowEmptyText ='暂无相关商品'
 						}
 					}
-				}).catch(error =>{
+				})
+				.catch(error =>{
 					this.$util.msg(error.msg,2000);
 				})
 			},
@@ -297,7 +307,7 @@
 				let productIdArr = [];
 				let productIds ='';
 				this.listData.map(item=>{// 0公开价格 1不公开价格 2仅对会员机构公开
-					productIdArr.push(item.p_id)
+					productIdArr.push(item.productId)
 				})
 				productIds = productIdArr.join(",");
 				this.ProductService.querySearchProductPrice({userId: this.clubUserId,productIds:productIds}).then(response =>{
@@ -311,7 +321,7 @@
 				let NewArray = []
 				Array.map(item=>{
 					for (let i = 0; i < list.length; i++) {
-						if( item.p_id == list[i].productId ){
+						if( item.productId == list[i].productId ){
 							NewArray.push(Object.assign(item,list[i])) 
 						}
 					}
@@ -341,10 +351,18 @@
 				this.loadingText = '加载中';
 				this.isShowEmpty = false;				
 				if(loadMore) {this.pageNum += 1;}
-				let params = {clubUserId:this.clubUserId,pageNum:this.pageNum,pageSize:this.zuhepageSize,searchWord:this.searchInputVal}
-				this.SellerService.GetCombinationProduct(params).then(response =>{
+				this.ProductService.GetSearchCombinationProduct(
+					{
+						clubUserId:this.clubUserId,
+						pageNum:this.pageNum,
+						pageSize:this.zuhepageSize,
+						searchWord:this.searchInputVal,
+						}
+					)
+				.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;
@@ -371,7 +389,8 @@
 						this.isShowEmpty = true;
 						this.isShowEmptyText ='暂无相关商品'
 					}
-				}).catch(error =>{
+				})
+				.catch(error =>{
 					this.$util.msg(error.msg,2000);
 				})
 			},
@@ -451,7 +470,7 @@
 				})
 			},
 			processActivityPrice(pros){//单独处理活动价格和阶梯价格
-				let ladderPriceList = pros.ladderPriceList;
+				let ladderPriceList = pros.ladderPrices;
 				if(pros.ladderPriceFlag == '0' || pros.actStatus == 1){
 					pros.totalPrice = pros.initProductNum*pros.retailPrice
 				}else{

+ 5 - 13
pages/goods/instrument-details.vue

@@ -191,7 +191,8 @@
 					title: ''		// 导航栏 中间的标题
 				},
 				linkPath:'',
-				popupShow:false//参数弹窗
+				popupShow:false,//参数弹窗
+				description:''
 			}
 		},
 		computed: {
@@ -219,6 +220,7 @@
 				this.ProductService.GetEquipmentDetails({equipmentId:this.equipmentId}).then(response =>{	
 					let data = response.data 
 					let pageMap = data.pageContentMap
+					this.description = pageMap.description
 					this.secondFloorList = pageMap.secondFloorList
 					this.firstFloorList = pageMap.firstFloorList
 					this.crmDetailList = pageMap.pcDetailList
@@ -275,16 +277,6 @@
 				})
 				return systeminfo
 			},
-			onShare(res){//分享转发
-				if (res.from === 'button') {
-			      // 来自页面内转发按钮
-			    }
-				return {
-				  title: `${this.product.name}`,
-				  path: `pages/goods/product?type=share&id=${this.productID}`,
-				  imageUrl:`${this.productImage[0]}`
-				}
-			},
 			showPopup(){
 				this.popupShow = true
 			},
@@ -317,8 +309,8 @@
 		      // 来自页面内转发按钮
 		    }
 			return {
-			  title: `${this.product.name}`,
-			  path: `pages/goods/product?type=share&id=${this.productID}`,
+			  title: `${this.description}`,
+			  path: `pages/goods/instrument-details?id=${this.equipmentId}`,
 			  imageUrl:`${this.productImage[0]}`
 			}
 		},

+ 3 - 3
seller/pages/cart/immediately.vue

@@ -247,11 +247,11 @@
 			getzuheCart(){//组合商品加入购物车
 				let productInfo=[];
 				let setGoodsList ={};
-				let productID = '';
+				let productId = '';
 				let productNum ='';
 				this.handleData.combinationProductList.forEach(item =>{
 					if(item.initProductNum >0){
-						setGoodsList.productId = item.productID
+						setGoodsList.productId = item.productId
 						setGoodsList.productNum =item.initProductNum
 						productInfo.push(JSON.parse(JSON.stringify(setGoodsList)))
 					}
@@ -281,7 +281,7 @@
 			},
 			getAddProductCart(){//增加购物车成功和toast弹窗提示成功
 				let params ={
-						productId:this.handleData.p_id,
+						productId:this.handleData.productId,
 						clubId:this.clubID,
 						serviceProviderId:this.serviceProviderId,
 						num:this.number

+ 21 - 2
services/product.service.js

@@ -154,7 +154,12 @@ export default class ProductService {
 	}
 	/* 项目仪器详情 */
 	GetEquipmentDetails (data = {}) {
-		return this.AjaxService.get({ url:'/equipment/recommend', data, isLoading: true })
+		return this.AjaxService.get({ 
+			url:'/commodity/equipment/details', 
+			data, 
+			isLoading: true ,
+			isHost:true
+		})
 	}
 	/* 查询搜索历史记录 */
 	GetProductSearchHistory (data = {}) {
@@ -186,13 +191,27 @@ export default class ProductService {
 			isHost:true
 		})
 	}
+	/* 搜索分类商品列表 */
+	GetSearchCombinationProduct (data = {}) {
+		return this.AjaxService.get({ 
+			url:'/commodity/seller/product/combination', 
+			data, 
+			isLoading: true,
+			isHost:true
+		})
+	}
 	/* 获取商品评价 */
 	GetProductEvaluate (data = {}) {
 		return this.AjaxService.get({ url:'/product/evaluate', data, isLoading: false })
 	}
 	/* 获取再次购买商品列表 */
 	GetRepeatBuyAgainProductList (data = {}) {
-		return this.AjaxService.get({ url:'/repeat/buyAgain', data, isLoading: true })
+		return this.AjaxService.get({ 
+			url:'/commodity/product/repeat', 
+			data, 
+			isLoading: true ,
+			isHost:true
+		})
 	}
 	/* 新商品搜索查询商品阶梯价格 */
 	GetSearchProductLadderPrice (data = {}) {

+ 0 - 10
services/sellse.service.js

@@ -92,16 +92,6 @@ export default class SellerService {
 	GetSellerClubOrderList (data = {}) {
 		return this.AjaxService.get({ url:'/seller/clubOrder', data, isLoading: true })
 	}
-	/**
-	 *@协销帮机构下单组合商品搜索
-	 *@param clubUserId 机构的userID
-	 *@param pageNum 	页码
-	 *@param pageSize 	条数
-	 *@param searchWord 搜索关键词
-	 */
-	GetCombinationProduct (data = {}) {
-		return this.AjaxService.get({ url:'/seller/combinationProduct/search', data, isLoading: true })
-	}
 	/**
 	 *@协销-二手下单商品列表
 	 *@param 二手商品分类 secondHandType	1二手仪器,2临期产品,3其他  【必传】

+ 5 - 1
services/shop.service.js

@@ -57,7 +57,11 @@ export default class ShopService {
 	}
 	/* 小程序供应商我的店铺详情 */
 	GetSupplierHomeDeatils (data = {}) {
-		return this.AjaxService.get({ url:'/supplier/home/detail', data, isLoading: true })
+		return this.AjaxService.get({ 
+			url:'/supplier/home/detail', 
+			data, 
+			isLoading: true ,
+		})
 	}
 	/* 小程序供应商我的店铺banner */
 	GetSupplierHomeBanner (data = {}) {

+ 25 - 22
supplier/pages/user/my-product.vue

@@ -327,6 +327,7 @@
 						}
 					}
 				})
+				console.log(this.dataList)
 			},
 			handSearchList(){//搜索
 				this.GetProductListInfo()
@@ -372,15 +373,12 @@
 				}
 			},
 			handleAddShopRemb(item){//添加主页推荐
-				console.log(this.featuredNum);
 				let num = 4- this.featuredNum;
-				console.log(num);
 				this.OperationType = 'add'
 				this.handlerProduct = item
 				this.modal = true;
 				this.contentModalText = `总共能添加4个主推商品,您还能添加${num}个确定将该商品添加为主推商品吗?`;
 			},
-			
 			handleDeleteShopRemb(item){//删除主页推荐
 				this.OperationType = 'delete'
 				this.handlerProduct = item
@@ -394,27 +392,30 @@
 				this.contentModalText = '确定下架该商品吗?';
 			},
 			handleAllUnder(){//批量下架操作
-				let isValidFlag = false
+				let checkedArray = [];
+				let isValidFlag = false;
+				this.productIds = '';
 				if(this.isProductChecked){
 					this.dataList.forEach(el => {
 						if(el.isChecked) { 
-							if(el.validFlag != 2){ 
-								isValidFlag = true; 
-							}else{
-								isValidFlag = false
-								this.productIds += el.productId+','
-							}
+							checkedArray.push(el)						
 						}
 					})
+					checkedArray.forEach(el =>{
+						if(el.validFlag == 2){
+							this.productIds += el.productId+','
+						}
+						if(el.validFlag != 2){
+							isValidFlag = true; 
+						}	
+					})
 					if(isValidFlag){
 						this.$util.modal('','部分选中的商品暂未上架,不能进行下架操作','确定','',false,() =>{})
-					}else{	
-						this.OperationType = 'allunder'
-						this.modal = true;
-						this.contentModalText = '确定下架选中的商品吗?';												
+						return;
 					}
-				}else{
-					return;
+					this.OperationType = 'allunder'
+					this.modal = true;
+					this.contentModalText = '确定下架选中的商品吗?';												
 				}
 			},
 			handleClick(e) {//弹窗提示用户操作
@@ -469,6 +470,7 @@
 			SupplierAllSoldOutProduct(ids){//操作批量下架商品
 				this.ShopService.SupplierSoldOutProduct({productIds:ids}).then(response =>{
 					this.$util.msg('下架成功',2000,true,'success');
+					this.productIds = '';
 					setTimeout(() => {
 						this.GetProductListInfo()
 					},2000)
@@ -582,6 +584,7 @@
 			},
 			checkedSoperv(item){//选择
 				item.isChecked = !item.isChecked
+				console.log(item)
 				this.updateCheckAllBtn()
 			},
 			supervClickFn(){//管理全选
@@ -605,12 +608,12 @@
 			verifyColorFilter: function(state){
 				let stateColor = '',
 					stateColorObject={
-						'2':'#1890f9',
-						'1':'#f9a94b',
-						'0':'#FFB12A',
-						'3':'#627386',
-						'8':'#FF2A2A',
-						'9':'#f94b4b'
+						0:'#FFB12A',
+						1:'#f9a94b',
+						2:'#1890f9',
+						3:'#627386',
+						8:'#FF2A2A',
+						9:'#f94b4b'
 					};
 				Object.keys(stateColorObject).forEach(function(key){
 					if(key == state){