ソースを参照

commit -m 修改

zhengjinyi 4 年 前
コミット
4460f44ccb
4 ファイル変更26 行追加174 行削除
  1. 16 39
      pages/user/cart/cart.vue
  2. 10 2
      services/product.service.js
  3. 0 10
      services/use.js
  4. 0 123
      services/user.service.js

+ 16 - 39
pages/user/cart/cart.vue

@@ -181,8 +181,7 @@
 			return{
 				modal:false,
 				contentModalText:'',
-				clubId:'',	//机构ID
-				userID:'',
+				userId:'',	//机构userId
 				kindCount:0,
 				serviceProviderId:'',//协销ID
 				isStock:'',
@@ -212,10 +211,7 @@
 				pageSize: 10,
 				pageNum: 1,
 				submitIds:[],
-				depositIds : [6060,6061,6062,6063,6064],//定金商品ID
-				rechargeIds : [6065,6066,6067,6068,6069],//充值余额商品ID
 				isIphoneX:this.$store.state.isIphoneX,
-				againBuyProductIds:''
 			}
 		},
 		onLoad(){
@@ -306,8 +302,13 @@
 				}, 500)
 			},
 			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 =>{
+				let params = {
+						userId:this.userId,
+						serviceProviderId:this.serviceProviderId,
+						pageNum:1,
+						pageSize:this.pageSize,
+					}
+				 this.ProductService.QueryShoppingCartList(params).then(response =>{
 					this.skeletonShow = false
 					this.$store.commit('updateAllNum',response.data.cartQuantity)
 					this.promotionsList = response.data.promotionsList;
@@ -373,8 +374,8 @@
 			},		
 			getOnReachBottomData(){//上拉加载
 				this.pageNum+=1
-				let params = {clubId:this.clubId,serviceProviderId:this.serviceProviderId,pageNum:this.pageNum,pageSize:this.pageSize}
-				this.SellerService.GetSellerShoppingInfo(params).then(response =>{
+				let params = {userId:this.userId,serviceProviderId:this.serviceProviderId,pageNum:this.pageNum,pageSize:this.pageSize}
+				this.ProductService.QueryShoppingCartList(params).then(response =>{
 					let resultsData = response.data.pageDate
 					this.promotionsList = response.data.promotionsList;
 					this.hasNextPage = resultsData.hasNextPage;
@@ -710,31 +711,8 @@
 							}
 						})
 					})
-					//判断勾选的商品是否为充值商品或者为定金商品的一些处理逻辑
-					const isHasDepositlds = productIdList.filter(item =>this.depositIds.includes(item))
-					const isHasRechargeIds = productIdList.filter(item =>this.rechargeIds.includes(item))
-					const isGoods= productIdList.every(item =>{ [...this.depositIds,...this.rechargeIds].includes(item)}) 
-					if(productIdList.length == 1 && isHasDepositlds.length === 1 && isHasRechargeIds.length === 0){
-						console.log('定金商品')
-						productIdList.forEach(item =>{
-							productID += item +','
-						})
-					}else if(productIdList.length == 1 && isHasRechargeIds.length === 1 && isHasDepositlds.length === 0){
-						console.log('充值余额商品')
-						productIdList.forEach(item =>{
-							productID += item +','
-						})
-					}else if(!isGoods && isHasRechargeIds.length === 0 && isHasDepositlds.length === 0){
-						console.log('正常商品')
- 						productIdList.forEach(item =>{
-							productID += item +','
-						})
-					}else{
-						this.$util.modal('提示','缴纳订金商品或余额充值商品请单独下单!','确定','',false,() =>{})
-						return
-					}
 					let cartPramsData={
-							clubId:this.clubId,
+							userId:this.userId,
 							allPrice:this.allPrice,
 							allCount:this.allCount,
 							productID:productID.substring(0,productID.lastIndexOf(',')),
@@ -842,12 +820,11 @@
 			uni.stopPullDownRefresh()
 		},
 		onShow(){
-			// this.$api.getComStorage('orderUserInfo').then((resolve) =>{
-			// 	console.log(resolve)
-			// 	this.clubId = resolve.clubID
-			// 	this.againBuyProductIds = resolve.againBuyProductIds
-			// 	this.initData()
-			// })
+			this.$api.getComStorage('clubInfo').then((resolve) =>{
+				console.log(resolve)
+				this.userId = resolve.userId
+				this.initData()
+			})
 		}
 	}
 </script>

+ 10 - 2
services/product.service.js

@@ -78,7 +78,11 @@ export default class ProductService {
 	 * @param:productCount 商品数量(必填)
 	 */
 	shoppingAddCart (data = {}) {
-		return this.AjaxService.post({ url:'/shopping/add/cart', data, isLoading: true })
+		return this.AjaxService.post({ 
+			url:'/shopping/add/cart', 
+			data, 
+			isLoading: true 
+		})
 	}
 	
 	/**
@@ -86,7 +90,11 @@ export default class ProductService {
 	 * @param:userId 用户ID(必填)
 	 */
 	QueryShoppingCartList (data = {}) {
-		return this.AjaxService.get({ url:'/shoppingCart/list', data, isLoading: false })
+		return this.AjaxService.get({ 
+			url:'/shopping/info', 
+			data, 
+			isLoading: false 
+		})
 	}
 	
 	/**

+ 0 - 10
services/use.js

@@ -118,16 +118,6 @@ export function invitationCodeLogin(params) {
 		})
 	})
 }
-/**
- *获取个人中心信息
- */
-export function personalInfo(params) {
-	return new Promise(function(resolve,reject) {
-		request.lodingGet('/personalCenter/myCentre',params, res => {
-			resolve(res)
-		})
-	})
-}
 /**
  *取消提示
  * userId

+ 0 - 123
services/user.service.js

@@ -36,36 +36,6 @@ export default class UserService {
 			isStatus: false
 		})
 	}
-	/* 供应商注册 */
-	appSupplierRegister(data = {}) {
-		return this.AjaxService.post({
-			url: '/supplier/register',
-			data,
-			isLoading: true
-		})
-	}
-	/* 初始化查询用户是否为正常用户 */
-	appSelectLoginUser(data = {}) {
-		return this.AjaxService.post({
-			url: '',
-			data,
-			isLoading: true
-		})
-	}
-	/**
-	 * 账号登录
-	 * @param mobileOrEmail 邮箱或手机
-	 * @param password	密码
-	 * @param source 来源 PC与小程序传:'www'crm就传'crm'
-	 */
-	AorganizationLogin(data = {}) {
-		return this.AjaxService.post({
-			url: '/user/login',
-			data,
-			isLoading: true,
-			isStatus: true
-		})
-	}
 	/**
 	 * @机构-地址列表
 	 * @param:userId 用户ID(必传),
@@ -103,97 +73,4 @@ export default class UserService {
 			isLoading: true
 		})
 	}
-	/**
-	 * @机构-个人中心
-	 * @param:userId 用户ID(必传),
-	 */
-	PersonalInfo(data = {}) {
-		return this.AjaxService.get({
-			url: '/personalCenter/myCentre',
-			data,
-			isLoading: false
-		})
-	}
-	/* 运营人员管理-列表 */
-	QueryOperatorList(data = {}) {
-		return this.AjaxService.get({
-			url: '/operation/list',
-			data,
-			isLoading: true
-		})
-	}
-	/* 运营人员管理-添加 */
-	PostAddOperator(data = {}) {
-		return this.AjaxService.post({
-			url: '/operation/add',
-			data,
-			isLoading: true
-		})
-	}
-	/* 运营人员管理-删除 */
-	PostDeleteOperator(data = {}) {
-		return this.AjaxService.post({
-			url: '/operation/delete',
-			data,
-			isLoading: true
-		})
-	}
-	/* 运营人员管理-更新邀请码 */
-	PostUpdateOperatorCode(data = {}) {
-		return this.AjaxService.post({
-			url: '/operation/updateInvitationCode',
-			data,
-			isLoading: true
-		})
-	}
-	/* 机构资料*/
-	OrganizationUpdateModifyInfo(data = {}) {
-		return this.AjaxService.get({
-			url: '/user/club/applicationData',
-			data,
-			isLoading: true
-		})
-	}
-	/* 机构升级会员机构 */
-	OrganizationRegister(data = {}) {
-		return this.AjaxService.post({
-			url: '/club/upgrade',
-			data,
-			isLoading: true
-		})
-	}
-	/* 机构提交资料修改 */
-	OrganizationUpdate(data = {}) {
-		return this.AjaxService.post({
-			url: '/operation/modifiedData',
-			data,
-			isLoading: true
-		})
-	}
-	/* 供应商资料信息-数据回显 */
-	SupplierShopInfo(data = {}) {
-		return this.AjaxService.get({
-			url: '/supplier/shopInfo',
-			data,
-			isLoading: true
-		})
-	}
-	/* 供应商资料信息-提交修改 */
-	SupplierModifiedData(data = {}) {
-		return this.AjaxService.post({
-			url: '/supplier/modifiedData',
-			data,
-			isLoading: true
-		})
-	}
-	/* 供应商修改申请信息保存 */
-	SupplierUpdateCompanyInfo(data = {}) {
-		return this.AjaxService.post({
-			url: '/supplier/updateCompanyInfo',
-			data,
-			isLoading: true
-		})
-	}
-
-
 }