Bläddra i källkod

commit -m 商品模块服务化

zhengjinyi 4 år sedan
förälder
incheckning
f60dad1a83

+ 22 - 0
App.vue

@@ -8,6 +8,28 @@
 	export default {
 		onLaunch: function() {
 			let self = this
+			//小程序热更新代码
+			// if (wx.canIUse('getUpdateManager')) {
+			// 	const updateManager = wx.getUpdateManager()
+			// 	updateManager.onCheckForUpdate(function (res) {
+			//         console.log('onCheckForUpdate====', res)
+			//         // 请求完新版本信息的回调
+			//         if (res.hasUpdate) {
+			// 			console.log('res.hasUpdate====')
+			// 			updateManager.onUpdateReady(function () {// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
+			// 				self.$util.modal('更新提示','新版本已经准备好,是否重启应用?','确定','取消',true,() =>{
+			// 					updateManager.applyUpdate()
+			// 				})
+			// 			})
+			// 			updateManager.onUpdateFailed(function () {  // 新的版本下载失败
+			// 				self.$util.modal('已经有新版本了哟~','新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~','确定','取消',true,() =>{
+			// 					// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
+			// 					updateManager.applyUpdate()
+			// 				})
+			// 			})
+			//         }
+			// 	})
+			// }
 			uni.getSystemInfo({
 				success: function(e) {
 					let modelmes = e.model;

+ 32 - 6
pages/goods/goods-active.vue

@@ -62,6 +62,9 @@
 				nomoreText: '上拉显示更多',
 			}
 		},
+		computed: {
+			...mapState(['identity'])
+		},
 		onLoad(option) {
 			this.promotionsId=option.id
 			this.$api.getComStorage('userInfo').then((resolve) =>{
@@ -78,16 +81,30 @@
 		},
 		methods: {
 			initSsoMemberCollectionList(id){//凑单初始化
-				this.ProductService.queryProductPromotionInfo({promotionsId:this.promotionsId}).then(response =>{
+				this.ProductService.queryProductPromotionInfo(
+					{
+						promotionsId:this.promotionsId,
+					}
+				)
+				.then(response =>{
 					let data = response.data
 					this.promotionsInfo = data
 					this.queryProductPromotionList()
-				}).catch(error =>{
+				})
+				.catch(error =>{
 					this.$util.msg(error.message,2000)
 				})	
 			},
 			queryProductPromotionList(id){//查询凑单商品列表
-				this.ProductService.queryProductPromotionList({pageNum:this.pageNum,pageSize:this.pageSize,promotionsId:this.promotionsId}).then(response =>{
+				this.ProductService.queryProductPromotionList(
+					{
+						identity:this.identity,
+						pageNum:this.pageNum,
+						pageSize:this.pageSize,
+						promotionsId:this.promotionsId,
+					}
+				)
+				.then(response =>{
 					let data = response.data
 					if(data.list && data.list.length > 0){
 						this.hasNextPage = data.hasNextPage;
@@ -109,13 +126,21 @@
 							}
 						}
 					}
-				}).catch(error =>{
+				})
+				.catch(error =>{
 					this.$util.msg(error.message,2000)
 				})	
 			},
 			getOnReachBottomData(){//上滑加载
 				this.pageNum+=1
-				this.ProductService.queryProductPromotionList({pageNum:this.pageNum,pageSize:this.pageSize,promotionsId:this.promotionsId}).then(response =>{
+				this.ProductService.queryProductPromotionList(
+					{
+						pageNum:this.pageNum,
+						pageSize:this.pageSize,
+						promotionsId:this.promotionsId,
+					}
+				)
+				.then(response =>{
 					let data = response.data
 					if(data.list&&data.list.length > 0){
 						this.hasNextPage = data.hasNextPage;
@@ -132,7 +157,8 @@
 							this.nomoreText = '已至底部'
 						}
 					}
-				}).catch(error =>{
+				})
+				.catch(error =>{
 					this.$util.msg(error.msg,2000)
 				})
 			},

+ 3 - 3
search/pages/search/search-instrument.vue

@@ -24,9 +24,9 @@
 				<view class="txt">暂无项目仪器数据^_^</view>
 			</view>
 			<view v-else class="supplier-list">
-					<view class="list clearfix" v-for="(item, index) in list" :key="index" @click.stop="navToDetailPage(item.e_id)">
-						<image class="pros-item-image" :src="item.e_image" mode="scaleToFill"></image>
-						<view class="pros-name">{{ isInterceptHtmlFn(item.e_name) }}</view>
+					<view class="list clearfix" v-for="(item, index) in list" :key="index" @click.stop="navToDetailPage(item.id)">
+						<image class="pros-item-image" :src="item.image" mode="scaleToFill"></image>
+						<view class="pros-name">{{ isInterceptHtmlFn(item.name) }}</view>
 					</view>
 					<!--加载loadding-->
 					<tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>

+ 9 - 9
search/pages/search/search-supplier.vue

@@ -26,10 +26,10 @@
 			<view v-else class="supplier-list">
 					<view class="list clearfix" v-for="(item, index) in supplierList" :key="index">
 						<view class="list-top">
-							<view class="list-top-supplier" @click="goSupplier(item.s_id)">
-								<view class="logo"><img :src="item.s_logo" alt=""></view>
+							<view class="list-top-supplier" @click="goSupplier(item.shopId)">
+								<view class="logo"><img :src="item.logo" alt=""></view>
 								<view class="main">
-									<view class="name">{{ item.s_name }}</view>
+									<view class="name">{{ item.name }}</view>
 									<view class="massgs">
 										<view class="label">满意度:</view>
 										<view class="p-stars">
@@ -42,8 +42,8 @@
 							<view class="list-top-msg">
 								<view class="msg-pin clearfix">
 									<view class="label">经营品项:</view>
-									<view class="label-li" v-if="item.s_business">
-										<text class="text" v-for="(label, idx) in SetNewBusiness(item.s_business)" :key="idx">{{ label }}</text>
+									<view class="label-li" v-if="item.business">
+										<text class="text" v-for="(label, idx) in SetNewBusiness(item.business)" :key="idx">{{ label }}</text>
 									</view>
 									<view class="label-li" v-else>
 										<text class="none">暂无</text>
@@ -51,14 +51,14 @@
 								</view>
 								<view class="msg-pin clearfix">
 									<view class="label">所在地区:</view>
-									<view class="label-text">{{ item.s_address ? item.s_address : '暂无'}}</view>
+									<view class="label-text">{{ item.address ? item.address : '暂无'}}</view>
 								</view>
 							</view>
 						</view>
 						<view class="list-bottom">
-							<view class="pros-item" v-for="(pros, pdx) in item.products" :key="pdx" @click.stop="navToDetailPage(pros.p_id)">
-								<image class="pros-item-image" :src="pros.p_image" mode="scaleToFill"></image>
-								<view class="pros-name">{{ pros.p_name }}</view>
+							<view class="pros-item" v-for="(pros, pdx) in item.products" :key="pdx" @click.stop="navToDetailPage(pros.id)">
+								<image class="pros-item-image" :src="pros.image" mode="scaleToFill"></image>
+								<view class="pros-name">{{ pros.name }}</view>
 							</view>
 						</view>
 					</view>

+ 16 - 16
second/pages/form/form.vue

@@ -54,7 +54,7 @@
 							</view>	
 						</tui-bottom-popup>	
 					 </view>
-					 <view class="row" v-if="secondParams.brandID==161">
+					 <view class="row" v-if="secondParams.brandId==161">
 						 <view class="label">其它品牌</view>
 						 <view class="spacing">
 							 <input type="text" maxlength="40" v-model="secondParams.brandName" placeholder="请输入商品品牌" placeholder-class="placeholder">
@@ -87,7 +87,7 @@
 					 <view class="row">
 						 <view class="label">交易价</view>
 						 <view class="spacing">
-							 <input type="text" maxlength="20" v-model="secondParams.price1"  placeholder="请输入交易价" placeholder-class="placeholder">
+							 <input type="text" maxlength="20" v-model="secondParams.price"  placeholder="请输入交易价" placeholder-class="placeholder">
 						 </view>
 					 </view>
 					 <view style="margin-top: 15rpx;">
@@ -130,19 +130,19 @@
 					 <view class="row">
 						 <view class="label">联系方式</view>
 						 <view class="spacing">
-							 <input type="text"  v-model="secondParams.contactMobile" maxlength="11" placeholder="请输入联系人手机号" placeholder-class="placeholder">
+							 <input type="text" v-model="secondParams.contactMobile" maxlength="11" placeholder="请输入联系人手机号" placeholder-class="placeholder">
 					    </view> 
 					 </view>
 					 <view class="row">
-						 <view class="label">采美对接人</view>
+						 <view class="label">采美对接人</view> 
 						 <view class="spacing">
-							 <input type="text"  v-model="secondParams.dockingPeopleName" maxlength="15" placeholder="请输入采美对接人姓名" placeholder-class="placeholder">
+							 <input type="text" v-model="secondParams.dockingPeopleName" maxlength="15" placeholder="请输入采美对接人姓名" placeholder-class="placeholder">
 					    </view> 
 					 </view>
 					 <view class="row">
 						 <view class="label">对接人联系方式</view>
 						 <view class="spacing">
-							 <input type="text"  v-model="secondParams.dockingPeopleMobile" maxlength="11" placeholder="请输入采美对接人手机号" placeholder-class="placeholder">
+							 <input type="text" v-model="secondParams.dockingPeopleMobile" maxlength="11" placeholder="请输入采美对接人手机号" placeholder-class="placeholder">
 					    </view> 
 					 </view>
 					 <view class="row">
@@ -269,18 +269,18 @@
 				],
 				BrandList:[],
 				isShow:false,
-				GoodsImagesList:[],
+				GoodsImagesList:['https://img.caimei365.com/group1/M00/03/CB/Cmis2F_NkrqAfl7uAADETMOGKpQ791.png'],
 				vShow_GoodsImages:false,
 				secondParams:{
 					secondHandType:'',//一级分类
 					instrumentType:'',//二手仪器分类
 					name:'',
-					brandID:'',//品牌ID
+					brandId:'',//品牌ID
 					brandName:'',//其他品牌
 					fixedYears:null,//出厂
 					companyName:'',//公司名称
 					maturityYears:'',//产品到期
-					price1:'',//交易价
+					price:'',//交易价
 					detailTalkFlag:1,//是否启用详聊
 					normalPrice:'',//市场价
 					originalPrice:'',//采购价
@@ -293,7 +293,7 @@
 					secondProductType:'',//
 					townId:'',//县区地址
 					address:'',//详细地址
-					image1:'',//图片
+					image:'https://img.caimei365.com/group1/M00/03/CB/Cmis2F_NkrqAfl7uAADETMOGKpQ791.png',//图片
 					productDetails:'',//商品详细信息
 					source:2
 				 },
@@ -318,9 +318,9 @@
 			   this.secondParams.productDetails = e.detail.value;
 			},
 			radioChange(e){//品牌
-				this.secondParams.brandID = e.target.value;
+				this.secondParams.brandId = e.target.value;
 				this.BrandList.forEach((item,index)=>{
-					if(item.id==this.secondParams.brandID){
+					if(item.id==this.secondParams.brandId){
 						this.brandname = item.name;
 						this.popupShow = false;
 					}
@@ -365,12 +365,12 @@
 			 uploadGoodsImagesFn(event){//上传商品图片
 				uploadFileImage().then(res =>{
 					 this.GoodsImagesList.push(JSON.parse(res.data).data);
-					 this.secondParams.image1 =this.GoodsImagesList.toString()+',';
+					 this.secondParams.image =this.GoodsImagesList.toString()+',';
 				})
 			},
 			 removeGoodsImagesFn(index){//删除商品图片
 				this.GoodsImagesList.splice(index,1);
-				this.secondParams.image1 =this.GoodsImagesList.toString()+',';
+				this.secondParams.image =this.GoodsImagesList.toString()+',';
 			 },
 			getProductType(e){
 			  this.secondParams.secondProductType = e.target.value ;
@@ -386,7 +386,7 @@
 						return;
 					}
 				}
-				if(this.secondParams.brandID == ''){
+				if(this.secondParams.brandId == ''){
 					this.$util.msg('请选择商品品牌',2000);
 					return;
 				}
@@ -400,7 +400,7 @@
 				// 		 return
 				// 	} 
 				// }
-				if(!this.$api.isNumber(this.secondParams.price1)){
+				if(!this.$api.isNumber(this.secondParams.price)){
 					  this.$util.msg('请输入交易价',2000);
 						return
 				}

+ 1 - 1
second/pages/product/product-list.vue

@@ -47,7 +47,7 @@
 		                        <text v-if="item.detailTalkFlag ==2 && hasLogin==false">¥详聊</text>
 		                        <text v-else-if="!hasLogin" class="priceparam" @click.stop="this.$api.navigateTo('/pages/login/login')">登录查看价格></text>
 		                        <text v-else-if="hasLogin && item.detailTalkFlag==2">¥详聊</text>
-		                        <text v-else>¥{{item.price1Str}}</text>
+		                        <text v-else>¥{{item.price}}</text>
 		                    </view>
 							<view class="shijian">
 								<text class="iconfont  icon-shijian"></text> {{item.onLineDateStr}}

+ 35 - 6
services/product.service.js

@@ -48,7 +48,12 @@ export default class ProductService {
 	 * @param:promotionsId 促销ID
 	 */
 	queryProductPromotionInfo (data = {}) {
-		return this.AjaxService.get({ url:'/product/promotion/info', data, isLoading: false })
+		return this.AjaxService.get({ 
+			url:'/commodity/promotions/info', 
+			data, 
+			isLoading: false ,
+			isHost:true
+		})
 	}
 	/**
 	 * @查询凑单商品列表
@@ -57,7 +62,12 @@ export default class ProductService {
 	 * @param:pageNum 查询页数
 	 */
 	queryProductPromotionList (data = {}) {
-		return this.AjaxService.get({ url:'/product/promotion/products', data, isLoading: true })
+		return this.AjaxService.get({ 
+			url:'/commodity/promotions/product', 
+			data, 
+			isLoading: true ,
+			isHost:true
+		})
 	}
 	
 	/**
@@ -66,7 +76,11 @@ export default class ProductService {
 	 * @param:productIds 商品ID
 	 */
 	queryProductDetils (data = {}) {
-		return this.AjaxService.get({ url:'/product/details', data, isLoading: false })
+		return this.AjaxService.get({ 
+			url:'/product/details', 
+			data, 
+			isLoading: false ,
+		})
 	}
 	/**
 	 * @商品详情-相关推荐
@@ -121,11 +135,21 @@ export default class ProductService {
 	}
 	/* 活动专题列表 */
 	GetPromotionsrList (data = {}) {
-		return this.AjaxService.get({ url:'/promotions/list', data, isLoading: true })
+		return this.AjaxService.get({ 
+			url:'/commodity/promotions/list', 
+			data, 
+			isLoading: true ,
+			isHost:true
+		})
 	}
 	/* 搜索项目仪器列表 */
 	GetSearchEquipmentList (data = {}) {
-		return this.AjaxService.get({ url:'/search/query/equipment', data, isLoading: true })
+		return this.AjaxService.get({ 
+			url:'/commodity/search/query/equipment', 
+			data, 
+			isLoading: true ,
+			isHost:true
+		})
 	}
 	/* 项目仪器详情 */
 	GetEquipmentDetails (data = {}) {
@@ -154,7 +178,12 @@ export default class ProductService {
 	}
 	/* 搜索分类商品列表 */
 	GetSearchProductTypeData (data = {}) {
-		return this.AjaxService.get({ url:'/search/query/product/type', data, isLoading: true })
+		return this.AjaxService.get({ 
+			url:'/commodity/search/query/product/type', 
+			data, 
+			isLoading: true ,
+			isHost:true
+		})
 	}
 	/* 获取商品评价 */
 	GetProductEvaluate (data = {}) {

+ 12 - 2
services/second.service.js

@@ -11,7 +11,12 @@ export default class SecondService {
 	 *@param 搜索关键词 searchKeyword	【选传】 
 	 */
 	SeconHandProductList (data = {}) {
-		return this.AjaxService.get({ url:'/product/getSecondHandProductList', data, isLoading: true })
+		return this.AjaxService.get({ 
+			url:'/commodity/second/list', 
+			data, 
+			isLoading: true ,
+			isHost:true
+		})
 	}
 	/*二手发布/品牌列表 */
 	brandList (data = {}) {
@@ -19,7 +24,12 @@ export default class SecondService {
 	}
 	/*二手发布/提交发布 */
 	SecondHandProduct (data = {}) {
-		return this.AjaxService.post({ url:'/product/releaseSecondHandProduct', data, isLoading: true })
+		return this.AjaxService.post({ 
+			url:'/commodity/second/release', 
+			data, 
+			isLoading: true ,
+			isHost:true
+		})
 	}
 	/*二手发布/浏览量 */
 	ProductCount (data = {}) {

+ 6 - 1
services/shop.service.js

@@ -17,7 +17,12 @@ export default class ShopService {
 	}
 	/* 小程序-搜索供应商列表 */
 	GetSearchSupplierList (data = {}) {
-		return this.AjaxService.get({ url:'/search/query/supplier', data, isLoading: true })
+		return this.AjaxService.get({ 
+			url:'/commodity/search/query/shop', 
+			data, 
+			isLoading: true ,
+			isHost:true
+		})
 	}
 	/* 小程序供应商个人中心 */
 	GetHomePageData (data = {}) {