Administrator 5 years ago
parent
commit
5e0c630caf
4 changed files with 87 additions and 13 deletions
  1. 18 0
      api/seller.js
  2. 2 1
      common/config/config.js
  3. 10 0
      pages.json
  4. 57 12
      seller/pages/cart/immediately.vue

+ 18 - 0
api/seller.js

@@ -271,6 +271,24 @@ export function getSellerProduct(params) {
 		})
 	})
 }
+/**
+ *@协销帮机构下单组合商品搜索
+ *@param clubUserId 机构的userID
+ *@param pageNum 	页码
+ *@param pageSize 	条数
+ *@param searchWord 搜索关键词
+ */
+export function getcombinationProduct(params) {
+	return new Promise(function(resolve,reject) {
+		request.lodingGet('/seller/combinationProduct/search',params,res => {
+			if(res.code == 0){
+				resolve(res)
+			}else{
+				reject(res)
+			}
+		})
+	})
+}
 /**
  *@协销商品搜索
  *@param clubId 会所ID

+ 2 - 1
common/config/config.js

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

+ 10 - 0
pages.json

@@ -431,5 +431,15 @@
 		"navigationBarTitleText": "采美采购商城",
 		"navigationBarBackgroundColor": "#FFFFFF",
 		"backgroundColor": "#FFFFFF"
+	},
+	"condition" : { //模式配置,仅开发期间生效
+		"current": 0, //当前激活的模式(list 的索引项)
+		"list": [
+			{
+				"name": "", //模式名称
+				"path": "", //启动页面,必选
+				"query": "" //启动参数,在页面的onLoad函数里面得到
+			}
+		]
 	}
 }

+ 57 - 12
seller/pages/cart/immediately.vue

@@ -4,6 +4,9 @@
 						  :search-status="true" 
 						  @operationConfim="hanldOperationConfim"
 						  @goCartPage="hanldToCartPage"
+						  :tabBars="tabBars"
+						  :tabIndex="tabIndex"
+						  @changetab="hanldChangeTab"
 						  >
 		</immediately-list>
 		<!--底部选择模态层弹窗组件 -->
@@ -16,7 +19,7 @@
 						<image :src="handleData.mainImage" mode=""></image>
 					</view>
 					<view class="layer-nunbox">
-						<view class="layer-nunbox-m">商品编码:{{item.price1Text}}</view>
+						<view class="layer-nunbox-m">商品编码:{{productCode}}</view>
 						<view class="layer-nunbox-t">
 							<view class="layer-nunbox-text">数量:</view>
 							<view class="number-box">
@@ -34,30 +37,28 @@
 					</view>
 				</view>
 				<view class="btn">
-					<view class="button add" @click="getAddProductCart">加入购物车</view>
+					<view class="button add" @click="getAddProductCart">{{buttonText}}</view>
 				</view>
 			</view>
-		</view>
-		
-		
+		</view>		
 		<!-- 加入购物车 -->
-		<view class="popup spec" :class="specClass"  @touchmove.stop.prevent="discard" @tap="hideSpec">
+		<view class="popup spec zuhe" :class="specClasszuhe"  @touchmove.stop.prevent="discard" @tap="hideSpecs">
 			<!-- 遮罩层 -->
 			<view class="mask"></view>
 			<view class="layer" @tap.stop="discard">
-				<view class="content">
+				<view class="content zuhe-content">
 					<view class="number-left">
-						<text>种类</text>
-						<text>数量</text>
+						<text>种类:1312</text>
+						<text>数量:132454</text>
 					</view>
 					<view class="number-right">
 						<view class="text">
-							总额
+							总额:<text class="number-right-text">¥1321552</text>
 						</view>
 					</view>
 				</view>
 				<view class="btn">
-					<view class="button add" @click="getAddProductCart">确定</view>
+					<view class="button add" @click="">确定</view>
 				</view>
 			</view>
 		</view>
@@ -80,12 +81,16 @@
 				lastPageType: '',
 				lastPageVal: '',
 				specClass: '',//规格弹窗css类,控制开关动画
+				specClasszuhe:'',//组合加购物车弹窗
+				productCode:'',
 				handleData:{},
 				isQuantity:false,
 				isStock:false,
 				minBuyNumber:0,
 				number:0,
-				buyRetailPrice:0
+				buyRetailPrice:0,
+				hanldChangeTabIndex:0,
+				buttonText:'加入购物车'
 			}
 		},
 		onLoad() {
@@ -97,12 +102,28 @@
 					this.$refs.productList.cartQuantity = response.data
 				})
 			},
+			hanldChangeTab(index){
+				console.log(this.$refs.productList.tabIndex)
+				if(index == 1){
+					this.$refs.productList.getcombinationProduct()
+				}
+			},
+			addCart(data){
+				this.specClasszuhe = 'show';
+			},
 			hanldOperationConfim(data){//显示选择数量确认弹窗
 				this.specClass = 'show';
 				this.handleData = data
+				this.productCode = data.productCode
 				this.number = data.minBuyNumber
 				this.minBuyNumber = data.minBuyNumber
 				this.buyRetailPrice = data.retailPrice;
+				if(this.$refs.productList.tabIndex == 1){
+					this.number = 0
+					this.buttonText ='确定'
+				}else{
+					this.buttonText ='加入购物车';
+				}
 			},
 			hideSpec() {//关闭选择数量确认弹窗
 				this.specClass = 'hide';
@@ -110,6 +131,12 @@
 					this.specClass = 'none';
 				}, 200);
 			},
+			hideSpecs(){
+				this.specClasszuhe='hide';
+				setTimeout(() => {
+					this.specClasszuhe='none';
+				}, 200);
+			},
 			changeCountAdd(){//popup弹窗数量增加按钮
 				this.number++
 				this.calculatPerice()
@@ -183,6 +210,19 @@
 </script>
 
 <style lang="scss">
+	.zuhe-content{
+		display: inherit;
+		line-height: 100rpx
+	}
+	.number-left{
+		margin-right: 60rpx
+	}
+	.number-left text{
+		margin-left: 30rpx;
+	}
+	.number-right-text{
+		color: #FF2A2A;
+		}
 	page {
 		background: $sub-bg-color;
 		.all-type-list-wrapper {
@@ -407,4 +447,9 @@
 			}
 		}
 	}	
+	
+	.zuhe .layer{
+		bottom: -260rpx;
+		height: 200rpx;
+	}
 </style>